Category: iterators
Component type: concept
A Forward Iterator is an iterator that corresponds to the usual intuitive notion of a linear sequence of values. It is possible to use Forward Iterators (unlike Input Iterator and Output Iterator) in multipass algorithms. Forward Iterators do not, however, allow stepping backwards through a sequence, but only, as the name suggests, forward.
A type that is a model of Forward Iterator may be either mutable or immutable, as defined in the Trivial Iterator requirements.
Input Iterator, Output Iterator
The same as for Input Iterator
X | A type that is a model of Forward Iterator |
T | The value type of X |
i, j | Object of type X |
t | Object of type T |
Forward Iterator does not define any new expressions beyond those defined in Input Iterator. However, some of the restrictions described in Input Iterator are relaxed.
| Name | Expression | Type requirements | Return type |
|---|---|---|---|
| Preincrement | ++i | X& | |
| Postincrement | i++ | X |
Forward Iterator does not define any new expressions beyond those defined in Input Iterator. However, some of the restrictions described in Input Iterator are relaxed.
| Name | Expression | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
| Preincrement | ++i | i is dereferenceable | i points to the next value | i is dereferenceable or past-the-end. &i == &++i. If i == j, then ++i == ++j. [1] |
| Postincrement | i++ | i is dereferenceable | Equivalent to {X tmp = i; ++i; return tmp;} | i is dereferenceable or past-the-end. [1] |
The complexity of operations on Forward Iterators is guaranteed to be amortized constant time.
T* IndexedSkipList< T, R >::iterator IndexedSkipList< T, R >::const_iterator IndexedSSkipList< T, R >::iterator IndexedSSkipList< T, R >::const_iterator IndexedTinySkipList< T, R >::iterator IndexedTinySkipList< T, R >::const_iterator SkipList< T, Pr, R >::iterator SkipList< T, Pr, R >::const_iterator SSkipList< T, Pr, R >::iterator SSkipList< T, Pr, R >::const_iterator AutoSkipList< T, Pr, R >::iterator AutoSkipList< T, Pr, R >::const_iterator AutoSSkipList< T, Pr, R >::iterator AutoSSkipList< T, Pr, R >::const_iterator MultiSkipList< T, Pr, R >::iterator MultiSkipList< T, Pr, R >::const_iterator MultiSSkipList< T, Pr, R >::iterator MultiSSkipList< T, Pr, R >::const_iterator MultiAutoSkipList< T, Pr, R >::iterator MultiAutoSkipList< T, Pr, R >::const_iterator MultiAutoSSkipList< T, Pr, R >::iterator MultiAutoSSkipList< T, Pr, R >::const_iterator KeyedSkipList< K, T, Pr, R >::iterator KeyedSkipList< K, T, Pr, R >::const_iterator KeyedSSkipList< K, T, Pr, R >::iterator KeyedSSkipList< K, T, Pr, R >::const_iterator MultiKeyedSkipList< K, T, Pr, R >::iterator MultiKeyedSkipList< K, T, Pr, R >::const_iterator MultiKeyedSSkipList< K, T, Pr, R >::iterator MultiKeyedSSkipList< K, T, Pr, R >::const_iterator AutoKeyedSkipList< K, T, Pr, R >::iterator AutoKeyedSkipList< K, T, Pr, R >::const_iterator AutoKeyedSSkipList< K, T, Pr, R >::iterator AutoKeyedSSkipList< K, T, Pr, R >::const_iterator MultiAutoKeyedSkipList< K, T, Pr, R >::iterator MultiAutoKeyedSkipList< K, T, Pr, R >::const_iterator MultiAutoKeyedSSkipList< K, T, Pr, R >::iterator MultiAutoKeyedSSkipList< K, T, Pr, R >::const_iterator XIndexedSkipList< X, CT >::iterator XIndexedSkipList< X, CT >::const_iterator XMultiSkipList< X, CT, Pr >::iterator XMultiSkipList< X, CT, Pr >::const_iterator XMultiAutoSkipList< X, CT, Pr >::iterator XMultiAutoSkipList< X, CT, Pr >::const_iterator AccessSkipList< K, T, A, Pr, R >::iterator AccessSkipList< K, T, A, Pr, R >::const_iterator AccessSSkipList< K, T, A, Pr, R >::iterator AccessSSkipList< K, T, A, Pr, R >::const_iterator MultiAccessSkipList< K, T, A, Pr, R >::iterator MultiAccessSkipList< K, T, A, Pr, R >::const_iterator MultiAccessSSkipList< K, T, A, Pr, R >::iterator MultiAccessSSkipList< K, T, A, Pr, R >::const_iterator AutoAccessSkipList< K, T, A, Pr, R >::iterator AutoAccessSkipList< K, T, A, Pr, R >::const_iterator AutoAccessSSkipList< K, T, A, Pr, R >::iterator AutoAccessSSkipList< K, T, A, Pr, R >::const_iterator MultiAutoAccessSkipList< K, T, A, Pr, R >::iterator MultiAutoAccessSkipList< K, T, A, Pr, R >::const_iterator MultiAutoAccessSSkipList< K, T, A, Pr, R >::iterator MultiAutoAccessSSkipList< K, T, A, Pr, R >::const_iterator XMultiAccessSkipList< X, K, CT, A, Pr >::iterator XMultiAccessSkipList< X, K, CT, A, Pr >::const_iterator XMultiAutoAccessSkipList< X, K, CT, A, Pr >::iterator [1] The restrictions described in Input Iterator have been removed. Incrementing a forward iterator does not invalidate copies of the old value and it is guaranteed that, if i and j are dereferenceable and i == j, then ++i == ++j. As a consequence of these two facts, it is possible to pass through the same Forward Iterator twice.
SkipList, SSkipList, KeyedSkipList, KeyedSSkipList, AutoSkipList, AutoSSkipList, AutoKeyedSkipList, AutoKeyedSSkipList, MultiSkipList, MultiSSkipList, MultiKeyedSkipList, MultiKeyedSSkipList, MultiAutoSkipList, MultiAutoSSkipList, MultiAutoKeyedSkipList, MultiAutoKeyedSSkipList, IndexedSkipList, IndexedSSkipList, IndexedTinySkipList, XIndexedSkipList, XMultiSkipList, XMultiAutoSkipList, AccessSkipList, AccessSSkipList, AutoAccessSkipList, AutoAccessSSkipList, MultiAccessSkipList, MultiAccessSSkipList, MultiAutoAccessSkipList, MultiAutoAccessSSkipList, XMultiAccessSkipList, XMultiAutoAccessSkipList,
Input Iterator, Output Iterator, Bidirectional Iterator, Bidirectional Iterator LOGN, Random Access Iterator, Random Access Iterator LOGN, Arbitrary Access Iterator LOGN, Forward Arbitrary Access Iterator, Forward Arbitrary Access Iterator LOGN, Reverse Arbitrary Access Iterator, Reverse Arbitrary Access Iterator LOGN, Iterator Overview
1.7.3