Default comparisons (since C++20)

Comparison operator functions can be explicitly defaulted to request the compiler to generate the corresponding default comparison for a class.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 2539C++20the synthesized three-way comparison would choosestatic_cast even if the explicit conversion is not availabledoes not choosestatic_cast in this case
CWG 2546C++20the defaulted secondary operator@ was notdefined as deleted if the overload resolution ofx @ y selects a non-usable rewritten candidatedefined as deletedin this case
CWG 2547C++20it was unclear whether comparison operatorfunctions for non-classes can be defaultedthey cannot be defaulted
CWG 2568C++20the implicit definition of comparison operatorfunctions might violate member access rulesaccess checks are performedfrom a context equivalentto their function bodies

# See also