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

A program that refers to a deleted function implicitly or explicitly, other than to declare it, is ill-formed.

Recommended practice: The resulting diagnostic message should include the text of the unevaluated-string, if one is supplied.

[Note 1:

This includes calling the function implicitly or explicitly and forming a pointer or pointer-to-member to the function.

It applies even for references in expressions that are not potentially-evaluated.

For an overload set, only the function selected by overload resolution is referenced.

The implicit odr-use ([basic.def.odr]) of a virtual function does not, by itself, constitute a reference.

The unevaluated-string, if present, can be used to explain the rationale for deletion and/or to suggest an alternative.

— _end note_]

A deleted function is implicitly an inline function ([dcl.inline]).

[Note 2:

The one-definition rule ([basic.def.odr]) applies to deleted definitions.

— _end note_]

A deleted definition of a function shall be the first declaration of the function or, for an explicit specialization of a function template, the first declaration of that specialization.

An implicitly declared allocation or deallocation function ([basic.stc.dynamic]) shall not be defined as deleted.

[Example 4: struct sometype { sometype();}; sometype::sometype() = delete; — _end example_]