24 Containers library [containers]

24.2 Requirements [container.requirements]

24.2.2 General containers [container.gen.reqmts] Optional container requirements [container.opt.reqmts]

The following operations are provided for some types of containers but not others.
Those containers for which the listed operations are provided shall implement the semantics as described unless otherwise stated.
If the iterators passed to lexicographical_­compare_­three_­way meet the constexpr iterator requirements ([iterator.requirements.general]) then the operations described below are implemented by constexpr functions.
a <=> b
Result: synth-three-way-result<X​::​value_­type>.
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.
Returns: lexicographical_­compare_­three_­way(a.begin(), a.end(), b.begin(), b.end(),
[Note 1:
The algorithm lexicographical_­compare_­three_­way is defined in [algorithms].
— end note]
Complexity: Linear.