cplusplus / draft

C++ standards drafts
http://www.open-std.org/jtc1/sc22/wg21/
5.73k stars 751 forks source link

Should "Copy Operation" be a word of power? #448

Open mclow opened 9 years ago

mclow commented 9 years ago

The phrase "Copy operation" (meaning, apparently, copy construction and assignment) is used as part of class.copy, and then again in allocator.requirements (twice).

Should it be a formal term in the standard?

cpplearner commented 9 years ago

Not so apparent. The "copy operation" in [class.copy]p31 means copy construction only, and the ones in [allocator.requirements] can be replaced by "copy assignment".

Also note that there are

If I'm not mistaken, only the "copy or move operation" in [iterator.requirements.general]p6 refers to both construction and assignment operation.

jensmaurer commented 7 years ago

Note that a copy might be performed by something that is not a copy constructor as defined in 12.8 [class.copy]. Nowadays, we run full overload resolution on the constructors for the copy, and we might actually choose a constructor template (which is never a copy constructor) to perform the copy. Therefore, changing "copy/move operation" to "copy/move construction" should be carefully considered on a case-by-case basis.

jensmaurer commented 6 years ago

Editorial meeting: Change [fs.enum.copy.opts] to use "file copy operation". Use of "copy operation" in core language sections is fine (contrasts with "move operation"). The two in allocator requirements: the first is "copy assignment operation" clearly, and the second one is "copy assignment operation", too. Also change "move operation" to "move assignment operation". Also change "move operation" in p4.

[lib.types.movedfrom] use "move constructors and move assignment operators". Also drop "shall".

22.2.1p7 [iterator.requirements.general] "Whether singular or not, use of a value-initialized iterator ..." Assignment has two objects involved; are we discussing the source or target? Turn in this into a bulleted list. "whereby the singular value is overwritten" --> "operation" -> "constructor or assignment operator/operation" and open a new issue that the wording is unclear.