...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A Forward Sequence is a Sequence whose elements are arranged in a definite order. The ordering is guaranteed not to change from iteration to iteration. The requirement of a definite ordering allows the definition of element-by-element equality (if the container's element type is Equality Comparable) and of lexicographical ordering (if the container's element type is LessThan Comparable).
Notation
s
A Forward Sequence
S
A Forward Sequence type
o
An arbitrary object
e
A Sequence element
For any Forward Sequence the following expressions must be valid:
Expression |
Return type |
Type Requirements |
Runtime Complexity |
---|---|---|---|
|
Constant |
||
|
Constant |
||
|
MPL Integral Constant. Convertible to int. |
Constant |
|
|
MPL Boolean Constant. Convertible to bool. |
Constant |
|
|
Any type |
Constant |
|
|
Any type |
|
Constant |
Expression |
Compile Time Complexity |
---|---|
|
Amortized constant time |
|
Amortized constant time |
|
Unspecified |
|
Constant time |
|
Amortized constant time |
Expression |
Semantics |
---|---|
|
An iterator to the first element of the sequence; see |
|
A past-the-end iterator to the sequence; see |
|
The size of the sequence; see |
|
A boolean Integral Constant |
|
The first element in the sequence; see |
For any Forward Sequence s the following invariants always hold: