...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
A Bidirectional Iterator
A Bidirectional Iterator type
An MPL integral constant
An integral constant
In addition to the requirements defined in Forward Iterator, the following expressions must be valid:
Expression |
Return type |
Runtime Complexity |
---|---|---|
next(i) |
Constant |
|
prior(i) |
Constant |
|
advance_c<N>(i) |
Constant |
|
advance<M>(i) |
Constant |
Expression |
Compile Time Complexity |
---|---|
result_of::prior<I>::type |
Amortized constant time |
The semantics of an expression are defined only where they differ from, or are not defined in Forward Iterator
Expression |
Semantics |
---|---|
prior(i) |
An iterator to the element preceding i |
In addition to the invariants of Forward Iterator, the following invariants always hold: