This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
Core Issues List revision 112e.
See http://www.open-std.org/jtc1/sc22/wg21/ for the official
Which special member functions can be defaulted?
Section: 9.5 [dcl.fct.def]
Submitter: Daveed Vandevoorde
Date: 27 May, 2009
[Voted into WP at March, 2010 meeting.]
The only restriction placed on the use of “=default”
in 9.5 [dcl.fct.def] paragraph 9 is that a defaulted function must
be a special member function. However, there are many variations of
declarations of special member functions, and it's not clear which of
those should be able to be defaulted. Among the possibilities:
by-value parameter for a copy assignment operator
arbitrary return values for copy assignment operators
a const reference parameter when the implicit
function would have a non-const
Presumably, you should only be able to default a function if it
is declared compatibly with the implicit declaration that would have
Proposed resolution (October, 2009):
Change 9.5 [dcl.fct.def] paragraph 9 as follows:
A function definition of the form:
decl-specifier-seqopt attribute-specifieropt declarator = default ;
is called an explicitly-defaulted definition.
member functions may be explicitly defaulted, and the implementation
shall define them as if they had implicit definitions (11.4.5 [class.ctor], 11.4.7 [class.dtor], 220.127.116.11 [class.copy.ctor]).
A special member function that would be implicitly
defined as deleted may be explicitly defaulted only on its first
declaration, in which case it is defined as deleted. A special member
function is user-provided if it is user-declared and not
explicitly defaulted on its first declaration. A user-provided
explicitly-defaulted function is defined at the point where it is
explicitly defaulted. [Note:...
[Editorial note: this change incorporates the overlapping portion
of the resolution of issue 667.]
...[Note: ...An explicitly-defaulted definition
Change 11.4.5 [class.ctor] paragraph 6 as follows:
exception-specification. —end note]
This resolution also resolves issue 905.
See also issue 667.