...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A Sequence (or, more precisely, an Input Sequence) is a compile-time entity to which you can apply begin
/end
operations in order to get iterators for accessing the range of its elements. In general, a sequence does not guarantee that its content doesn't change from one iteration to another, or between different compilation sessions [1]. See Forward Sequence for the definition of the concept that imposes such additional requirements.
Expression | Expression type |
---|---|
typename begin<s>::type | A model of Input Iterator |
typename end<s>::type | A model of Input Iterator |
See the description of begin/end operations.
For any sequence s
the following invariants always hold:
[begin<s>::type, end<s>::type)
is always a valid range;
[begin<s>::type, end<s>::type)
will pass through every element of s
(once);
begin<s>::type
is identical to end<s>::type
if and only if the sequence s
is empty.
[1] For example, a sequence might implement an interface to a compile-time random-number generator; for such sequence the begin/end
invocation might return different iterators on every subsequent compilation of the code.
Sequences, Forward Sequence, Input Iterator, begin
, end