std::Input Iterator

<iterator>
Input iterator category
Input

Input iterators are iterators especially designed for sequential input operations, where each value pointed by the iterator is read only once and then the iterator is incremented.

There is not a single type of input iterator: Each container defines its own specific iterator type able to iterate through it and access its elements. But all input iterators support -at least- the following operations:

characteristicvalid expressions
Can be copied and copy-constructedX b(a);
b = a;
Accepts equality/inequality comparisonsa == b
a != b
Can be dereferenced as an rvalue (when not null)*a
a->m
Can be incremented (when not null)++a
a++
*a++
Value type does not need to be assignablet = u not needed
Where X is an iterator type, a and b are objects of this iterator type, and t and u are objects of the type pointed by the iterator type.

Algorithms using input iterators should be one-pass algorithms (i.e., algorithms that pass through the same input iterator position once at most).

See also