Expression | Return type | Operational | Assertion/note | Complexity |
semantics | pre-/post-condition | |||
X::value_type | T | compile time | ||
X::reference | T& | compile time | ||
X::const_reference | const T& | compile time | ||
X::iterator | iterator type whose value type is T | any iterator category
that meets the forward iterator requirements. convertible to X::const_iterator. | compile time | |
X::const_iterator | constant iterator type whose value type is T | any iterator category
that meets the forward iterator requirements. | compile time | |
X::difference_type | signed integer type | is identical to the difference type of X::iterator and X::const_iterator | compile time | |
X::size_type | unsigned integer type | size_type can represent any non-negative value of difference_type | compile time | |
X u; | Postconditions: u.empty() | constant | ||
X() | Postconditions: X().empty() | constant | ||
X(a) | linear | |||
X u(a); X u = a; | Postconditions: u == a | linear | ||
X u(rv); X u = rv; | Postconditions: u is equal to the value that rv had before this construction | (Note B) | ||
a = rv | X& | All existing elements of a are either move assigned to or destroyed | Postconditions: a is equal to the value that rv
had before this assignment | linear |
a.~X() | void | linear | ||
a.begin() | iterator; const_iterator for constant a | constant | ||
a.end() | iterator; const_iterator for constant a | constant | ||
a.cbegin() | const_iterator | const_cast<X const&>(a).begin(); | constant | |
a.cend() | const_iterator | const_cast<X const&>(a).end(); | constant | |
i <=> j | strong_ordering | constant | ||
a == b | convertible to bool | == is an equivalence relation. equal(a.begin(), a.end(), b.begin(), b.end()) | Preconditions: T meets the Cpp17EqualityComparable requirements | Constant if a.size() != b.size(),
linear otherwise |
a != b | convertible to bool | Equivalent to !(a == b) | linear | |
a.swap(b) | void | Effects: exchanges the contents of a and b | (Note A) | |
swap(a, b) | void | Equivalent to a.swap(b) | (Note A) | |
r = a | X& | linear | ||
a.size() | size_type | distance(a.begin(), a.end()) | constant | |
a.max_size() | size_type | distance(begin(), end())
for the largest possible container | constant | |
a.empty() | convertible to bool | a.begin() == a.end() | constant |
i == j i != j i < j i <= j i >= j i > j i <=> j i - jwhere i and j denote objects of a container's iterator type, either or both may be replaced by an object of the container's const_iterator type referring to the same element with no change in semantics.
Expression | Return type | Assertion/note | Complexity |
pre-/post-condition | |||
X::reverse_iterator | iterator type whose value type is T | reverse_iterator<iterator> | compile time |
X::const_reverse_iterator | constant iterator type whose value type is T | reverse_iterator<const_iterator> | compile time |
a.rbegin() | reverse_iterator; const_reverse_iterator for constant a | reverse_iterator(end()) | constant |
a.rend() | reverse_iterator; const_reverse_iterator for constant a | reverse_iterator(begin()) | constant |
a.crbegin() | const_reverse_iterator | const_cast<X const&>(a).rbegin() | constant |
a.crend() | const_reverse_iterator | const_cast<X const&>(a).rend() | constant |
Expression | Return type | Operational | Assertion/note | Complexity |
semantics | pre-/post-condition | |||
a <=> b | synth-three-way-result<value_type> | lexicographical_compare_three_way(a.begin(), a.end(),
b.begin(), b.end(), synth-three-way) | Preconditions: Either <=> is defined for values of type (possibly const) T,
or < is defined for values of type (possibly const) T and
< is a total ordering relationship. | linear |
allocator_traits<A>::construct(m, p)
allocator_traits<A>::construct(m, p)where p is the address of the uninitialized storage for the element allocated within X.
allocator_traits<A>::construct(m, p, rv)and its evaluation causes the following postcondition to hold: The value of *p is equivalent to the value of rv before the evaluation.
allocator_traits<A>::construct(m, p, v)and its evaluation causes the following postcondition to hold: The value of v is unchanged and is equivalent to *p.
allocator_traits<A>::construct(m, p, args)
allocator_traits<A>::destroy(m, p)
Expression | Return type | Assertion/note | Complexity |
pre-/post-condition | |||
allocator_type | A | compile time | |
get_- allocator() | A | constant | |
X() X u; | Postconditions: u.empty() returns true, u.get_allocator() == A() | constant | |
X(m) | Postconditions: u.empty() returns true, | constant | |
X u(m); | u.get_allocator() == m | ||
X(t, m) X u(t, m); | Postconditions: u == t, u.get_allocator() == m | linear | |
X(rv) X u(rv); | Postconditions: u has the same elements as rv had before this
construction; the value of u.get_allocator() is the same as the
value of rv.get_allocator() before this construction. | constant | |
X(rv, m) X u(rv, m); | Postconditions: u has the same elements, or copies of the elements, that rv had before this construction, u.get_allocator() == m | constant if m == rv.get_allocator(), otherwise linear | |
a = t | X& | Postconditions: a == t | linear |
a = rv | X& | Preconditions: If allocator_- traits<allocator_type> ::propagate_on_container_- move_assignment::value is false, T is Cpp17MoveInsertable into X and Cpp17MoveAssignable. | linear |
a.swap(b) | void | Effects: exchanges the contents of a and b | constant |