...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A Random Access Iterator traverses a Sequence moving in either direction, permitting efficient arbitrary distance movements back and forward through the sequence.
Notation
i
, j
Random Access Iterators
I
, J
Random Access Iterator types
M
An MPL integral constant
N
An integral constant
In addition to the requirements defined in Bidirectional Iterator, the following expressions must be valid:
Expression |
Return type |
Runtime Complexity |
---|---|---|
|
Constant |
|
|
Constant |
|
|
Constant |
|
|
Constant |
Expression |
Compile Time Complexity |
---|---|
|
Amortized constant time |
|
Amortized constant time |
|
Amortized constant time |
vector
iterator
map
iterator
std::pair
iterator
boost::array
iterator
single_view
iterator
iterator_range
iterator (where adapted sequence is a Random
Access Sequence)
transform_view
iterator (where adapted sequence is a Random
Access Sequence)
reverse_view
iterator (where adapted sequence is a Random
Access Sequence)