|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <compare> | ||
inlinenamespace/* unspecified */{ inlineconstexpr/* unspecified */ weak_order=/* unspecified */; | (since C++20) | |
Call signature | ||
template<class T,class U> requires/* see below */ | ||
Compares two values using 3-way comparison and produces a result of typestd::weak_ordering.
Lett andu be expressions andT andU denotedecltype((t)) anddecltype((u)) respectively,std::weak_order(t, u) isexpression-equivalent to:
std::weak_order,T is a floating-point type:std::weak_ordering,std::weak_ordering that is consistent with the ordering observed byT's comparison operators,Contents |
The namestd::weak_order denotes acustomization point object, which is a constfunction object of aliteralsemiregular class type. SeeCustomizationPointObject for details.
Letx andy be values of same IEEE floating-point type, andweak_order_less(x, y) be the boolean result indicating ifx precedesy in the strict weak order defined by the C++ standard.
| This section is incomplete Reason: no example |
(C++20) | the result type of 3-way comparison that supports all 6 operators and is not substitutable (class)[edit] |
(C++20) | performs 3-way comparison and produces a result of typestd::strong_ordering(customization point object)[edit] |
(C++20) | performs 3-way comparison and produces a result of typestd::partial_ordering(customization point object)[edit] |
(C++20) | performs 3-way comparison and produces a result of typestd::weak_ordering, even ifoperator<=> is unavailable(customization point object)[edit] |