“Same cv-unqualified type”
_N4750_.15.8 [class.copy]
Richard Smith

Created on 2014-04-18.00:00:00 last changed 49 months ago


Date: 2015-05-15.00:00:00

[Moved to DR at the May, 2015 meeting.]

Date: 2014-11-15.00:00:00

Proposed resolution (November, 2014):

Change _N4750_.15.8 [class.copy] paragraph 31 as follows:

...This elision of copy/move operations, called copy elision, is permitted in the following circumstances (which may be combined to eliminate multiple copies):

  1. in a return statement in a function with a class return type, when the expression expression is the name of a non-volatile automatic object (other than a function or catch-clause parameter or a variable introduced by the exception-declaration of a handler (14.4 [except.handle])) with the same cv-unqualified type (ignoring cv-qualification) as the function return type, the copy/move operation can be omitted by constructing the automatic object directly into the function's return value

  2. in a throw-expression...

  3. when a temporary class object that has not been bound to a reference (6.7.7 [class.temporary]) would be copied/moved to a class object with the same cv-unqualified type (ignoring cv-qualification), the copy/move operation can be omitted by constructing the temporary object directly into the target of the omitted copy/move

  4. when the exception-declaration...

Date: 2020-12-15.00:00:00

_N4750_.15.8 [class.copy] paragraph 31 uses the phrase, “same cv-unqualified type,” twice. This is ambiguous, potentially either requiring that the types not be cv-qualified or meaning that cv-qualification should be ignored. The latter meaning is intended and the phrase should be replaced accordingly.

Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-11-10 00:00:00adminsetstatus: dr -> drwp
2015-05-25 00:00:00adminsetmessages: + msg6056
2015-05-25 00:00:00adminsetstatus: tentatively ready -> dr
2014-11-24 00:00:00adminsetmessages: + msg5167
2014-11-24 00:00:00adminsetstatus: drafting -> tentatively ready
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-04-18 00:00:00admincreate