...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 Sequence is a Forward Sequence whose iterators model Bidirectional Iterator.
Notation
s
A Forward Sequence
S
A Forward Sequence type
o
An arbitrary object
e
A Sequence element
In addition to the requirements defined in Forward Sequence, for any Bidirectional Sequence the following must be met:
Expression |
Return type |
Type Requirements |
Runtime Complexity |
---|---|---|---|
|
Constant |
||
|
Constant |
||
|
Any type |
Constant |
|
|
Any type |
|
Constant |
Expression |
Compile Time Complexity |
---|---|
|
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 Forward Sequence.
std::pair
boost::array
vector
reverse_view
single_view
iterator_range
(where adapted sequence is a Bidirectional Sequence)
transform_view
(where adapted sequence is a Bidirectional Sequence)
zip_view
(where adapted sequences are models of Bidirectional Sequence)