Created on 2011-12-08.00:00:00 last changed 46 months ago
Rationale (February, 2012):
This is a request to extend the language and is thus more appropriately considered by EWG.
[Adopted at the November, 2017 meeting as part of paper P0641R2.]
The current wording of 9.5.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 |
2021-02-17 00:00:00 | admin | set | status: extension -> cd5 |
2012-02-27 00:00:00 | admin | set | messages: + msg3864 |
2012-02-27 00:00:00 | admin | set | status: open -> extension |
2011-12-08 00:00:00 | admin | create |