[container.opt.reqmts]

# 23 Containers library [[containers]](./#containers)

## 23.2 Requirements [[container.requirements]](container.requirements#container.opt.reqmts)

### 23.2.2 General containers [[container.requirements.general]](container.requirements.general#container.opt.reqmts)

#### 23.2.2.4 Optional container requirements [container.opt.reqmts]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L896)

The following operations are provided
for some types of containers but not others[.](#1.sentence-1)

Those containers for which the
listed operations are provided shall implement the semantics as described
unless otherwise stated[.](#1.sentence-2)

If the iterators passed to lexicographical_compare_three_way meet the constexpr iterator requirements ([[iterator.requirements.general]](iterator.requirements.general "24.3.1 General"))
then the operations described below
are implemented by constexpr functions[.](#1.sentence-3)

[ð](#lib:operator%3c=%3e,containers)

`a <=> b
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L931)

*Result*: *synth-three-way-result*<X​::​value_type>[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L935)

*Preconditions*: Either T models [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]"),
or < is defined for values of type (possibly const) T and< is a total ordering relationship[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L941)

*Returns*: lexicographical_compare_three_way(a.begin(), a.end(),
b.begin(), b.end(),  
*synth-three-way*)

[*Note [1](#note-1)*:

The algorithm lexicographical_compare_three_way is defined in [[algorithms]](algorithms "26 Algorithms library")[.](#4.sentence-1)

â *end note*]

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L950)

*Complexity*: Linear[.](#5.sentence-1)
