std::Input Iterator
<iterator>
Input iterator category
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:
| characteristic | valid expressions |
| Can be copied and copy-constructed | X b(a);
b = a; |
| Accepts equality/inequality comparisons | a == 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 assignable | t = 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
- Output Iterator
- Output iterator category
- Forward Iterator
- Forward iterator category
- Bidirectional Iterator
- Bidirectional iterator category
- Random Access Iterator
- Random-access iterator category
- iterator
- Iterator base class (class template
)