...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
An Input Iterator is a Trivial Iterator that provides a way to obtain the next iterator in a sequence.
i
is incrementable if there is a "next" iterator, that is, if i::next
expression is well-defined; past-the-end iterators are not incrementable;
j
is reachable from an input iterator i
if, after recursive application of next
operation to i
a finite number of times, i
is identical to j
;
[i,j)
refers to a range of iterators beginning with i
and up to but not including j
;
[i,j)
is a valid range if both i
and j
are valid iterators, and j
is reachable from i
.
In addition to the expressions defined in Trivial Iterator, the following expressions must be valid.
Expression | Expression type |
---|---|
typename i::next | A model of Input Iterator |
Expression | Complexity | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typename i::next | Amortized constant time | i is incrementable | i::next is the next iterator in a sequence | i::next is dereferenceable or past-the-end |
Sequence, Trivial Iterator, Forward Iterator