If both operands have arithmetic types,
or one operand has integral type and
the other operand has unscoped enumeration type,
the usual arithmetic conversions are applied to the operands.
Otherwise, if the operands have integral type,
the result is of type stdβ::βstrong_Βordering.
The result is
stdβ::βstrong_Βorderingβ::βequal
if both operands are arithmetically equal,
stdβ::βstrong_Βorderingβ::βless
if the first operand is arithmetically
less than the second operand,
and
stdβ::βstrong_Βorderingβ::βgreater
otherwise.
Otherwise, the operands have floating-point type, and
the result is of type stdβ::βpartial_Βordering.
The expression a <=> b yields
stdβ::βpartial_Βorderingβ::βless
if a is less than b,
stdβ::βpartial_Βorderingβ::βgreater
if a is greater than b,
stdβ::βpartial_Βorderingβ::βequivalent
if a is equivalent to b,
and
stdβ::βpartial_Βorderingβ::βunordered otherwise.
If both operands have the same enumeration type E,
the operator yields the result of
converting the operands to the underlying type of E
and applying <=> to the converted operands.
If at least one of the operands is of pointer type and
the other operand is of pointer or array type,
array-to-pointer conversions ([conv.array]),
pointer conversions ([conv.ptr]),
and
qualification conversions
are performed on both operands
to bring them to their composite pointer type ([expr.type]).
After the conversions, the operands shall have the same type.
If the composite pointer type is an object pointer type,
p <=> q is of type stdβ::βstrong_Βordering.
If two pointer operands p and q compare equal ([expr.eq]),
p <=> q yields stdβ::βstrong_Βorderingβ::βequal;
if p and q compare unequal,
p <=> q yields
stdβ::βstrong_Βorderingβ::βless
if q compares greater than p
and
stdβ::βstrong_Βorderingβ::βgreater
if p compares greater than q ([expr.rel]).
The three comparison category types ([cmp.categories])
(the types
stdβ::βstrong_Βordering,
stdβ::βweak_Βordering, and
stdβ::βpartial_Βordering)
are not predefined;
if the header <compare> ([compare.syn])
is not imported or included prior to a use of such a class type β
even an implicit use in which the type is not named
(e.g., via the auto specifier
in a defaulted three-way comparison
or use of the built-in operator) β the program is ill-formed.