A class or pointer type
X
satisfies the requirements of an input iterator for the value type
T
if
X satisfies the Cpp17Iterator ([iterator.iterators]) and
Cpp17EqualityComparable ([tab:equalitycomparable]Table *tab:equalitycomparable) requirements and
the expressions in [tab:iterator.input.requirements]Table *tab:iterator.input.requirements are valid and have
the indicated semantics.

In [tab:iterator.input.requirements]Table *tab:iterator.input.requirements, the term
*the domain of ==*
is used in the ordinary mathematical sense to denote
the set of values over which
== is (required to be) defined.

This set can change over time.

Each algorithm places additional requirements on the domain of
== for the iterator values it uses.

[ Example

: *end example*

]The call find(a,b,x)
is defined only if the value of a
has the property p
defined as follows:
b has property p
and a value i
has property p
if
(*i==x)
or if
(*i!=x
and
++i
has property
p).

— Table 74 — Cpp17InputIterator requirements (in addition to Cpp17Iterator)

Expression | Return type | Operational | Assertion/note |

semantics | pre-/post-condition | ||

a != b | contextually convertible to bool | !(a == b) | |

*a | reference, convertible to T | ||

a->m | (*a).m | ||

++r | X& | Ensures: r is dereferenceable or r is past-the-end; any copies of the previous value of r are no longer required to be dereferenceable nor to be in the domain of ==. | |

(void)r++ | equivalent to (void)++r | ||

*r++ | convertible to T | { T tmp = *r; ++r; return tmp; } |

[ Note

: *end note*

](Equality does not guarantee the substitution property or referential transparency.)

Algorithms on input iterators should never attempt to pass through the same iterator twice.

They should be
*single pass*
algorithms.

Value type T is not required to be a Cpp17CopyAssignable type ([tab:copyassignable]Table *tab:copyassignable).

These algorithms can be used with istreams as the source of the input data through the
istream_iterator
class template.

—