...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A Forward Iterator traverses a Sequence allowing movement in only one direction through it's elements, one element at a time.
Notation
i
, j
Forward Iterators
I
, J
Forward Iterator types
M
An MPL integral constant
N
An integral constant
A type models Forward Iterator if, in addition to being CopyConstructable, the following expressions are valid:
Expression |
Return type |
Runtime Complexity |
---|---|---|
|
Constant |
|
|
Convertible to bool |
Constant |
|
Convertible to bool |
Constant |
|
Constant |
|
|
Constant |
|
|
|
Constant |
|
|
Constant |
|
|
Constant |
Expression |
Compile Time Complexity |
---|---|
|
Amortized constant time |
|
Amortized constant time |
|
Linear |
|
Linear |
|
Linear |
|
Amortized constant time |
|
Amortized constant time |
Expression |
Semantics |
---|---|
|
An iterator to the element following |
|
Iterator equality comparison |
|
Iterator inequality comparison |
|
An iterator n elements after |
|
Equivalent to |
|
The number of elements between |
|
The element at position |
|
Equivalent to |
The following invariants always hold:
std::pair
iterator
boost::array
iterator
vector
iterator
cons
iterator
list
iterator
set
iterator
map
iterator
single_view
iterator
filter_view
iterator
iterator_range
iterator
joint_view
iterator
transform_view
iterator
reverse_view
iterator