On this page
std::incrementable_traits
Defined in header <iterator> |
||
---|---|---|
|
(1) | (since C++20) |
|
(2) | (since C++20) |
|
(3) | (since C++20) |
|
(4) | (since C++20) |
|
(5) | (since C++20) |
Computes the associated difference type of the type I
, if any. Users may specialize incrementable_traits
for a program-defined type.
1) Primary template is an empty struct.
3) Specialization for const-qualified types.
4) Specialization for types that define a public and accessible member type
difference_type
. Provides a member type difference_type
equal to T::difference_type
.
5) Specialization for types that do not define a public and accessible member type
difference_type
but do support subtraction. Provides a member type difference_type
equal to 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
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) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/iterator/incrementable_traits