Otherwise, if a <=> b is usable or
overload resolution for a <=> b is performed and
finds at least one viable candidate,
the synthesized three-way comparison is not defined.
Otherwise, if R is not a comparison category type, or either
the expression a == b or the expression a < b
is not usable,
the synthesized three-way comparison is not defined.
Otherwise (when R is partial_ordering),
a == b ? partial_ordering::equivalent :
a < b ? partial_ordering::less :
b < a ? partial_ordering::greater :
partial_ordering::unordered
A synthesized three-way comparison is ill-formed
if overload resolution finds usable candidates
that do not otherwise meet the requirements implied by the defined expression.
Let R be the declared return type of
a defaulted three-way comparison operator function, and
let xi be the elements of
the expanded list of subobjects for
an object x of type C.
If R is auto, then
let cviRi be
the type of the expression xi<=>xi.
The operator function is defined as deleted
if that expression is not usable or
if Ri is not
a comparison category type ([cmp.categories.pre]) for any i.
The return type is deduced as
the common comparison type (see below) of
R0, R1, …, Rn−1.
The return value of type R
of the defaulted three-way comparison operator function
with parameters x and y of the same type
is determined by comparing corresponding elements
xi and yi
in the expanded lists of subobjects for x and y
(in increasing index order)
until the first index i where
the synthesized three-way comparison of type R
between xi and yi
yields a result value vi where vi!=0,
contextually converted to bool, yields true.
The return value is a copy of vi
if such an index exists and
static_cast<R>(std::strong_ordering::equal) otherwise.