10 Classes [class]

10.10 Comparisons [class.compare]

10.10.1 Defaulted comparison operator functions [class.compare.default]

A defaulted comparison operator function ([expr.spaceship], [expr.rel], [expr.eq]) for some class C shall be a non-template function declared in the member-specification of C that is
  • a non-static member of C having one parameter of type const C&, or
  • a friend of C having two parameters of type const C&.
A three-way comparison operator for a class type C is a structural comparison operator if it is defined as defaulted in the definition of C, and all three-way comparison operators it invokes are structural comparison operators.
A type T has strong structural equality if, for a glvalue x of type const T, x <=> x is a valid expression of type std::strong_­ordering or std::strong_­equality and either does not invoke a three-way comparison operator or invokes a structural comparison operator.