...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A Bidirectional Iterator traverses a Sequence allowing movement in either direction one element at a time.
Notation
i
A Bidirectional Iterator
I
A Bidirectional Iterator type
M
An MPL integral constant
N
An integral constant
In addition to the requirements defined in Forward Iterator, the following expressions must be valid:
Expression |
Return type |
Runtime Complexity |
---|---|---|
|
Constant |
|
|
Constant |
|
|
Constant |
|
|
Constant |
Expression |
Compile Time Complexity |
---|---|
|
Amortized constant time |
The semantics of an expression are defined only where they differ from, or are not defined in Forward Iterator
Expression |
Semantics |
---|---|
|
An iterator to the element preceding |
In addition to the invariants of Forward Iterator, the following invariants always hold:
std::pair
iterator
boost::array
iterator
vector
iterator
single_view
iterator
iterator_range
(where adapted sequence is a Bidirectional
Sequence)
transform_view
(where adapted sequence is a Bidirectional
Sequence)
reverse_view