std:: incrementable_traits
Defined in header
<iterator>
|
||
template
<
class
I
>
struct incrementable_traits { } ; |
(1) | (since C++20) |
template
<
class
T
>
requires
std::
is_object_v
<
T
>
|
(2) | (since C++20) |
template
<
class
T
>
struct
incrementable_traits
<
const
T
>
|
(3) | (since C++20) |
template
<
class
T
>
requires requires
{
typename
T
::
difference_type
;
}
|
(4) | (since C++20) |
template
<
class
T
>
requires
(
!
requires
{
typename
T
::
difference_type
;
}
)
&&
|
(5) | (since C++20) |
Computes the associated difference type of the type
I
, if any. A program may specialize
incrementable_traits
for a
program-defined type
.
difference_type
.
difference_type
same as
T::difference_type
.
difference_type
but do support subtraction.
difference_type
same as
std::
make_signed_t
<
decltype
(
std::
declval
<
T
>
(
)
-
std::
declval
<
T
>
(
)
)
>
. The implicit expression variations rule (see below) applies to the expression
a
-
b
.
Implicit expression variations
A requires expression that uses an expression that is non-modifying for some constant lvalue operand also requires implicit expression variations .
Example
This section is incomplete
Reason: no example |
See also
(C++20)
|
specifies that a
semiregular
type can be incremented with pre- and post-increment operators
(concept) |
(C++20)
(C++20)
(C++23)
(C++20)
(C++20)
(C++20)
|
computes the associated types of an iterator
(alias template) |
provides uniform interface to the properties of an iterator
(class template) |