Title
Copy/move construction and conversion functions
Status
drafting
Section
11.4.5.3 [class.copy.ctor]
Submitter
Nikolay Ivchenkov

Created on 2012-09-15.00:00:00 last changed 139 months ago

Messages

Date: 2012-09-15.00:00:00

Additional note (September, 2012):

The default arguments of an elided constructor can also have side effects and should be mentioned, as well; however, the elision should not change the odr-use status of functions and variables appearing in those default arguments.

Date: 2022-02-18.07:47:23

The current wording of 11.4.5.3 [class.copy.ctor] paragraph 31 refers only to constructors and destructors:

When certain criteria are met, an implementation is allowed to omit the copy/move construction of a class object, even if the constructor selected for the copy/move operation and/or the destructor for the object have side effects.

However, in some cases (e.g., auto_ptr) a conversion function is also involved in the copying, and it could presumably also have visible side effects that would be eliminated by copy elision. (Some additional contexts that may also require changes in this regard are mentioned in the resolution of issue 535.)

History
Date User Action Args
2012-11-03 00:00:00adminsetmessages: + msg4101
2012-11-03 00:00:00adminsetstatus: open -> drafting
2012-09-15 00:00:00admincreate