![]() |
Home | Libraries | People | FAQ | More |
A Bidirectional Iterator traverses a Sequence allowing movement in either direction one element at a time.
Notation
In addition to the requirements defined in Forward Iterator, the following expressions must be valid:
| Expression | Return type | Runtime Complexity |
|---|---|---|
| next(i) | Bidirectional Iterator | Constant |
| prior(i) | Bidirectional Iterator | Constant |
| advance_c<N>(i) | Bidirectional Iterator | Constant |
| advance<M>(i) | Bidirectional Iterator | 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:
| Copyright © 2001-2005 Joel de Guzman, Dan Marsden |