Title
Allowing additional parameter types in defaulted functions
Status
extension
Section
11.4.2 [dcl.fct.def.default]
Submitter
Nikolay Ivchenkov

Created on 2011-12-08.00:00:00 last changed 101 months ago

Messages

Date: 2012-02-15.00:00:00

Rationale (February, 2012):

This is a request to extend the language and is thus more appropriately considered by EWG.

Date: 2014-03-03.00:00:00

The current wording of 11.4.2 [dcl.fct.def.default] paragraph 1 allows copy constructors and copy assignment operators to have a reference to non-const parameter, even if the implicitly-declared function would have had a reference to const parameter. This is safe because the sub-object copy functions that take a reference to const parameter can be invoked with a non-const lvalue.

It would also be possible to allow the inverse situation — permitting the defaulted function to be defined with a reference to const parameter, even though the sub-object functions have a reference to non-const parameter — by defining the defaulted function as deleted.

See also issue 1331.

History
Date User Action Args
2012-02-27 00:00:00adminsetmessages: + msg3864
2012-02-27 00:00:00adminsetstatus: open -> extension
2011-12-08 00:00:00admincreate