Const reverse iterator type | X::const_reverse_iterator | A Reverse Iterator adaptor whose base iterator type is the container's const iterator type. [1] |
X
A type that is a model of Reversible Container
a, b
Object of type
In addition to the expressions defined in Forward Container, the following expressions must be valid.
Name | Expression | Return type |
---|---|---|
Beginning of range | a.rbegin() | |
End of range | a.rend() |
Semantics of an expression is defined only where it is not defined in Forward Container, or where there is additional information.
Name | Expression | Semantics | Postcondition |
---|---|---|---|
Beginning of reverse range | a.rbegin() | Equivalent to X::reverse_iterator(a.end()). | |
End of reverse range | a.rend() | Equivalent to X::reverse_iterator(a.begin()). |
The run-time complexity of
Valid range | |
Equivalence of ranges | The distance from |
• vector
• list
• deque
[1] A Container's iterator type and const iterator type may be the same type: a container need not provide mutable iterators. It follows from this that the reverse iterator type and the const reverse iterator type may also be the same.
The Iterator overview, Bidirectional Iterator, Sequence
Random Access Container
Category: containers
Component type: concept
A Random Access Container is a Reversible Container whose iterator type is a Random Access Iterator. It provides amortized constant time access to arbitrary elements.
Reversible Container
No additional types beyond those defined in Reversible Container. However, the requirements for the iterator type are strengthened: it must be a Random Access Iterator.