|
|
Defined in header <compare> | ||
inlinenamespace/* unspecified */{ inlineconstexpr/* unspecified */ | (since C++20) | |
Call signature | ||
template<class T,class U> requires/* see below */ | (since C++20) | |
Performs three-way comparison onsubexpressionst andu and produces a result of typestd::partial_ordering, even if the operator<=>
is unavailable.
Ifstd::decay_t<T> andstd::decay_t<U>> are the same type,std::compare_partial_order_fallback(t, u) isexpression-equivalent to:
In all other cases,std::compare_partial_order_fallback(t, u) is ill-formed, which can result insubstitution failure when it appears in the immediate context of a template instantiation.
Contents |
The namestd::compare_partial_order_fallback
denotes acustomization point object, which is a constfunction object of aliteralsemiregular
class type. SeeCustomizationPointObject for details.
This section is incomplete Reason: no example |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2114 (P2167R3) | C++20 | the fallback mechanism only required return types to be convertible tobool | constraints strengthened |
LWG 3465 | C++20 | the fallback mechanism did not requireu< t to be well-formed | required |
LWG 4157 | C++20 | P2167R3 overwrote the resolution ofLWG issue 3465 | restored the resolution |
(C++20) | performs 3-way comparison and produces a result of typestd::partial_ordering (customization point object)[edit] |