![]() |
Home | Libraries | People | FAQ | More |
A Random Access Sequence is a Bidirectional Sequence whose iterators model Random Access Iterator. It guarantees constant time access to arbitrary sequence elements.
Notation
sA Random Access Sequence
SA Random Access Sequence type
MAn MPL integral constant
NAn integral constant
oAn arbitrary object
eA Sequence element
In addition to the requirements defined in Bidirectional Sequence, for any Random Access Sequence the following must be met:
|
Expression |
Return type |
Type Requirements |
Runtime Complexity |
|---|---|---|---|
|
|
Constant |
||
|
|
Constant |
||
|
|
Any type |
Constant |
|
|
|
Any type |
|
Constant |
|
|
Any type |
Constant |
|
|
|
Any type |
|
Constant |
|
Expression |
Compile Time Complexity |
|---|---|
|
|
Amortized constant time |
|
|
Amortized constant time |
|
|
Amortized constant time |
|
|
Amortized constant time |
The semantics of an expression are defined only where they differ from, or are not defined in Bidirectional Sequence.
|
Expression |
Semantics |
|---|---|
|
|
The Mth element from the beginning of the sequence; see |
|
|
The Nth element from the beginning of the sequence; see |
std::pair
boost::array
vector
map
reverse_view
single_view
iterator_range
(where adapted sequence is a Random Access Sequence)
transform_view
(where adapted sequence is a Random Access Sequence)
zip_view
(where adapted sequences are models of Random Access Sequence)