Given an expanded list of subobjects for an object x of type C,
the type of the expression <=>
is denoted by .

If the declared return type
of a defaulted three-way comparison operator function
is auto,
then the return type is deduced as
the common comparison type (see below) of
, , …, .

[ Note

: *end note*

]Otherwise,
the program will be ill-formed
if the expression <=>
is not implicitly convertible to the declared return type for any i.

—
If the return type is deduced as void,
the operator function is defined as deleted.

The return value V 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
and
in the expanded lists of subobjects for x and y
(in increasing index order)
until the first index i
where <=>
yields a result value where ,
contextually converted to bool, yields true;
V is converted to R.

- Otherwise, if at least one is std::weak_equality, or at least one is std::strong_equality and at least one is std::partial_ordering or std::weak_ordering, U is std::weak_equality ([cmp.weakeq]).
- Otherwise, if at least one is std::partial_ordering, U is std::partial_ordering ([cmp.partialord]).