Difference between revisions of "cpp/iterator/incrementable"
From cppreference.com
m (removed unnessisary "(1)") |
(I just found a better definition of this concept elsewhere on cppreference...) |
||
Line 4: | Line 4: | ||
{{dcl header|iterator|since=c++20}} | {{dcl header|iterator|since=c++20}} | ||
{{dcl | since=c++20 | 1= | {{dcl | since=c++20 | 1= | ||
− | template < class | + | template<class I> |
− | concept incrementable = | + | concept incrementable = |
− | + | regular<I> && | |
+ | weakly_incrementable<I> && | ||
+ | requires(I i) { | ||
+ | { i++ } -> same_as<I>; | ||
+ | }; | ||
}} | }} | ||
{{dcl end}} | {{dcl end}} |
Revision as of 11:20, 5 October 2019
Defined in header <iterator>
|
||
template<class I> concept incrementable = |
(since C++20) | |
The concept incrementable<T> is satisfied if and only if T is weakly_incrementable, equality preserving, and is equality_comparable.
See also
(C++20) |
specifies that a semiregular type can be incremented with pre- and post-increment operators (concept) |
(C++20) |
specifies that a type is the same as another type (concept) |