cpp/utility/compare/weak order

Compares two values using 3-way comparison and produces a result of type.

Let and  be expressions and  and  denote  and  respectively,  is expression-equivalent to:
 * If is :
 * , if it is a well-formed expression with overload resolution performed in a context that does not include a declaration of ,
 * otherwise, if is a floating-point type:
 * if is, performs the weak ordering comparison of floating-point values (see below) and returns that result as a value of type ,
 * otherwise, yields a value of type that is consistent with the ordering observed by 's comparison operators,
 * otherwise,, if it is well-formed,
 * otherwise,, if it is well-formed.
 * In all other cases, the expression is ill-formed, which can result in substitution failure when it appears in the immediate context of a template instantiation.

Strict weak order of IEEE floating-point types
Let and  be values of same IEEE floating-point type, and  be the boolean result indicating if  precedes  in the strict weak order defined by the C++ standard.


 * If neither nor  is NaN, then  if and only if, i.e. all representations of equal floating-point value are equivalent;
 * If is negative NaN and  is not negative NaN, then ;
 * If is not positive NaN and  is positive NaN, then ;
 * If both and  are NaNs with the same sign, then, i.e. all NaNs with the same sign are equivalent.