[dcl.fct.def.default] (original) (raw)

Explicitly-defaulted functions and implicitly-declared functions are collectively called defaulted functions, and the implementation shall provide implicit definitions for them ([class.ctor], [class.dtor], [class.copy.ctor], [class.copy.assign]) as described below, including possibly defining them as deleted.

A defaulted prospective destructor ([class.dtor]) that is not a destructor is defined as deleted.

A defaulted special member function that is neither a prospective destructor nor an eligible special member function ([special]) is defined as deleted.

A function isuser-provided if it is user-declared and not explicitly defaulted or deleted on its first declaration.

A user-provided explicitly-defaulted function (i.e., explicitly defaulted after its first declaration) is implicitly defined at the point where it is explicitly defaulted; if such a function is implicitly defined as deleted, the program is ill-formed.

[Note 2:

Declaring a function as defaulted after its first declaration can provide efficient execution and concise definition while enabling a stable binary interface to an evolving code base.

— _end note_]

A non-user-provided defaulted function (i.e., implicitly declared or explicitly defaulted in the class) that is not defined as deleted is implicitly defined when it is odr-used ([basic.def.odr]) or needed for constant evaluation ([expr.const]).

[Note 3:

The implicit definition of a non-user-provided defaulted function does not bind any names.

— _end note_]