Defined in header <iterator> | ||
---|---|---|
template <class I> concept input_or_output_iterator = requires(I i) { { *i } -> /*can-reference*/; } && std::weakly_incrementable<I>; | (since C++20) |
The input_or_output_iterator
concept forms the basis of the iterator concept taxonomy; every iterator type satisfies the input_or_output_iterator
requirements.
The exposition-only concept /*can-reference*/
is satisfied if and only if the type is referenceable (in particular, not void
).
Expressions declared in requires-expressions of the standard library concepts are required to be equality-preserving (except where stated otherwise).
input_or_output_iterator
itself only specifies operations for dereferencing and incrementing an iterator. Most algorithms will require additional operations, for example:
sentinel_for
); indirectly_readable
and input_iterator
) indirectly_writable
and output_iterator
) forward_iterator
, bidirectional_iterator
, random_access_iterator
) Unlike the LegacyIterator requirements, the input_or_output_iterator
concept does not require copyability.
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator