Front Page / Sequences / Concepts / Forward Sequence |
A Forward Sequence is an MPL concept representing a compile-time sequence of elements. Sequence elements are types, and are accessible through Iterators. The begin and end metafunctions provide iterators delimiting the range of the sequence elements. A sequence guarantees that its elements are arranged in a definite, but possibly unspecified, order. Every MPL sequence is a Forward Sequence.
For any Forward Sequence s the following expressions must be valid:
Expression | Type | Complexity |
---|---|---|
begin<s>::type | Forward Iterator | Amortized constant time |
end<s>::type | Forward Iterator | Amortized constant time |
size<s>::type | Integral Constant | Unspecified |
empty<s>::type | Boolean Integral Constant | Constant time |
front<s>::type | Any type | Amortized constant time |
Expression | Semantics |
---|---|
begin<s>::type | An iterator to the first element of the sequence; see begin. |
end<s>::type | A past-the-end iterator to the sequence; see end. |
size<s>::type | The size of the sequence; see size. |
empty<s>::type | A boolean Integral Constant c such that c::value == true if and only if the sequence is empty; see empty. |
front<s>::type | The first element in the sequence; see front. |
For any Forward Sequence s the following invariants always hold:
Sequences, Bidirectional Sequence, Forward Iterator, begin / end, size, empty, front