[cmp.categories.pre]

# 17 Language support library [[support]](./#support)

## 17.12 Comparisons [[cmp]](cmp#categories.pre)

### 17.12.2 Comparison category types [[cmp.categories]](cmp.categories#pre)

#### 17.12.2.1 Preamble [cmp.categories.pre]

[1](#1)

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

The typespartial_ordering,weak_ordering, andstrong_ordering are collectively termed the [*comparison category types*](#def:comparison_category_types "17.12.2.1 Preamble [cmp.categories.pre]")[.](#1.sentence-1)

Each is specified in terms of an exposition-only data member named value whose value typically corresponds to that of an enumerator
from one of the following exposition-only enumerations:enum class *ord* { *equal* = 0, *equivalent* = *equal*, *less* = -1, *greater* = 1 }; // *exposition only*enum class *ncmp* { *unordered* = -127 }; // *exposition only*

[2](#2)

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

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

The type strong_ordering corresponds to the term
total ordering in mathematics[.](#2.sentence-1)

â *end note*]

[3](#3)

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

The relational and equality operators for the comparison category types
are specified with an anonymous parameter of unspecified type[.](#3.sentence-1)

This type shall be selected by the implementation such that
these parameters can accept literal 0 as a corresponding argument[.](#3.sentence-2)

[*Example [1](#example-1)*:

nullptr_t meets this requirement[.](#3.sentence-3)

â *end example*]

In this context, the behavior of a program that supplies
an argument other than a literal 0 is undefined[.](#3.sentence-4)

[4](#4)

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

For the purposes of [[cmp.categories]](cmp.categories "17.12.2 Comparison category types"),[*substitutability*](#def:substitutability "17.12.2.1 Preamble [cmp.categories.pre]") is the property that f(a) == f(b) is true whenever a == b is true,
where f denotes a function that reads only comparison-salient state
that is accessible via the argument's public const members[.](#4.sentence-1)
