...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
A Forward Sequence
A Forward Sequence type
An arbitrary object
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 |
---|---|---|---|
begin(s) |
|
Constant |
|
end(s) |
|
Constant |
|
back(s) |
Any type |
|
Constant |
back(s) = o |
Any type |
s is mutable and e = o, where e is the first element in the sequence, is a valid expression. |
Constant |
Expression |
Compile Time Complexity |
---|---|
result_of::begin<S>::type |
Amortized constant time |
result_of::end<S>::type |
Amortized constant time |
result_of::back<S>::type |
Amortized constant time |
The semantics of an expression are defined only where they differ from, or are not defined in Forward Sequence.