std::weakly_incrementable - cppreference.com (original) (raw)

For the definition of /*is-signed-integer-like*/, see is-integer-like .

This concept specifies requirements on types that can be incremented with the pre- and post-increment operators, but those increment operations are not necessarily equality-preserving, and the type itself is not required to be std::equality_comparable.

For std::weakly_incrementable types, a == b does not imply that ++a == ++b. Algorithms on weakly incrementable types must be single-pass algorithms. These algorithms can be used with istreams as the source of the input data through std::istream_iterator.

[edit] Semantic requirements

For an object i of type I, I models std::weakly_incrementable only if all following conditions are satisfied:

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
P2325R3 C++20 default_initializable was required not required

[edit] See also