In the C++20 standard, [dcl.fct.def.default], Explicitly-defaulted functions:
2 The type
T1of an explicitly defaulted special member functionFis allowed to differ from the typeT2it would have had if it were implicitly declared, as follows:(2.1) —
T1andT2may have differing ref-qualifiers;(2.2) —
T1andT2may have differing exception specifications; and(2.3) — if
T2has a parameter of typeconst C&, the corresponding parameter ofT1may be of typeC&.If
T1differs fromT2in any other way, then:(2.4) — if
Fis an assignment operator, and the return type ofT1differs from the return type ofT2orT1’s parameter type is not a reference, the program is ill-formed;(2.5) — otherwise, if
Fis explicitly defaulted on its first declaration, it is defined as deleted;(2.6) — otherwise, the program is ill-formed
Could anybody provide an example of a special member function explicitly defaulted and that is deleted by the compiler. The function declaration should be well-formed.