cpp/utility/compare/strong 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 ISO/IEC/IEEE 60559 totalOrder comparison of floating-point values and returns that result as a value of type std (note: this comparison can distinguish between the positive and negative zero and between the NaNs with different representations),
 * otherwise, yields a value of type std that is consistent with the ordering observed by 's comparison operators,
 * 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 total 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 total order defined by totalOrder in ISO/IEC/IEEE 60559.

if and only if and  have the same bit pattern.


 * if neither nor  is NaN:
 * if, then ;
 * if, then ;
 * if ,
 * if is negative zero and  is positive zero, ,
 * if is not zero and 's exponent field is less than 's, then  (only meaningful for decimal floating-point number);
 * if either or  is NaN:
 * 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 and 's mantissa field is less than 's, then.