Utilities for comparing and ordering values.
This namespace contains various tools for comparing and ordering values. In summary:
Eq
is a concept that allows you to require partial equality between values. It requires the==
and!=
operators to be available, which is typically implemented just by==
. Note that C++ does not model total vs partial equality so there's no differentiation for aPartialEq
concept.Ord
,StrongOrd
andPartialOrd
are concept that allows you to require total, unique, and partial orderings between values, respectively. Implementing them requires the<=>
operator to be defined, and makes the the<
,<=
,>
, and>=
operators accessible.Ordering
is a concept that matches any of the standard library ordering types which are returned from the<=>
operator:std::weak_ordering
,std::strong_ordering
, orstd::partial_ordering
.Reverse
is a struct that allows you to easily reverse an ordering.max
andmin
are functions that build off ofOrd
and allow you to find the maximum or minimum of two values. There are other similar functions that make use ofOrd
as well.
For more details, see the respective documentation of each item in the list.
Functions

Restrict a value to a certain interval.

Compares and returns the maximum of two values.

Compares and returns the maximum of two values with respect to the specified comparison function.

Returns the element that gives the maximum value from the specified function.

Compares and returns the minimum of two values.

Compares and returns the minimum of two values with respect to the specified comparison function.

Returns the element that gives the minimum value from the specified function.
Operators

Returns the reverse ordering of the
value
s in twoReserve
objects. 
Compares the
value
s in twoReserve
objects.
Concepts

Concept for types that can be compared for equality with the
==
and!=
operators. There is no guarantee of a full equivalence relation, and a partial equivalence is possible, which allows for values that compare notequal to themselves (such as NaN). 
Determines if the types
Lhs
andRhs
have total ordering (akastd::weak_ordering
), and that this is the strongest ordering that exists between the types. 
Determines if the types
Lhs
andRhs
have a partial ordering (akastd::partial_ordering
), and that this is the strongest ordering that exists between the types. 
Concept for types that have a unique total ordering (aka
std::strong_ordering
). 
Concept for types that form a total ordering (aka
std::weak_ordering
). 
Concept that combines all ordering types together.

Concept for types that form a partial ordering (aka
std::partial_ordering
). 
Concept for types that form a unique total order (aka
std::strong_ordering
). Objects that sort the same for ordering must also compare as equal.