C++ named requirements: SequenceContainer
From cppreference.com
A SequenceContainer is a Container that stores objects of the same type in a linear arrangement.
Requirements
Given the following types and values:
| Type | Definition |
C
|
a sequence container class |
T
|
the element type of C
|
A
|
the allocator type of C:
|
R (since C++23)
|
a type that models container-compatible-range <T>
|
Args (since C++11)
|
a template parameter pack |
Iter
|
C::iterator
|
Ref
|
C::reference
|
CRef
|
C::const_reference
|
| Value | Definition |
v
|
a value of type C
|
cv
|
a value of type const C
|
i, j
|
LegacyInputIterators such that [i, j) is a valid range and that the iterators refer to elements implicitly convertible to C::value_type
|
rg (since C++23)
|
a value of type R
|
il (since C++11)
|
a value of type std::initializer_list<C::value_type>
|
n
|
a value of type C::size_type
|
p
|
a valid const iterator into v
|
q
|
a valid dereferenceable const iterator into v
|
q1, q2
|
const iterators into v such that [q1, q2) is a valid range
|
t
|
a value(until C++11)an lvalue or const rvalue(since C++11) of type C::value_type
|
rv (since C++11)
|
a non-const rvalue of type C::value_type
|
args (since C++11)
|
a function parameter pack with the pattern Arg&&
|
C satisfies the requirements of SequenceContainer if all following conditions are satisfied:
Csatisfies the requirements of Container.- The following statements and expressions are well-formed and have the specified semantics:
| Basic operations (required for all sequence containers in the standard library except std::array(since C++11)) | |||
|---|---|---|---|
| Statement | Semantics[1] | ||
C c(n, t);
|
Effect | Constructs the sequence container holding n copies of t.
| |
| Precondition |
| ||
| Postcondition | std::distance(c.begin(), c.end()) is n.
| ||
C c(i, j);
|
Effect | Constructs the sequence container equal, element-wise, to the range [i, j).
| |
| Precondition |
| ||
| Postcondition | std:: | ||