[class.compare.secondary] (original) (raw)

11 Classes [class]

11.10 Comparisons [class.compare]

11.10.4 Secondary comparison operators [class.compare.secondary]

A secondary comparison operator is a relational operator ([expr.rel]) or the != operator.

A defaulted operator function ([over.binary]) for a secondary comparison operator @shall have a declared return type bool.

The operator function with parameters x and yis defined as deleted if

In any of the two overload resolutions above, the defaulted operator function is not considered as a candidate for the @ operator.

Otherwise, the operator function yields x @ y.

[Example 1: struct HasNoLessThan { };struct C { friend HasNoLessThan operator<=>(const C&, const C&);bool operator<(const C&) const = default; }; — _end example_]