Jens Maurer
2010-11-11
N3203=10-0193

Tightening the conditions for generating implicit moves

This paper presents the specific wording changes necessary to implement option #2 in Bjarne Stroustrup's paper "N3201=10-0191: Moving right along".

Change in 12.8 class.copy paragraph 8:

If the class definition does not explicitly declare a copy constructor, and there is no user-declared move constructor, and there is no user-declared move assignment operator, a copy constructor is implicitly declared as defaulted (8.4 dcl.fct.def 8.4.2 dcl.fct.def.default). Such implicit declaration is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. ...
Change in 12.8 class.copy paragraph 10:
If the class definition of a class X does not explicitly declare a move constructor, one will be implicitly declared as defaulted if and only if
Change in 12.8 class.copy paragraph 20:
If the class definition does not explicitly declare a copy assignment operator, there is no user-declared move constructor, and there is no user-declared move assignment operator, a copy assignment operator is implicitly declared as defaulted (8.4 dcl.fct.def 8.4.2 dcl.fct.def). Such implicit declaration is deprecated if the class has a user-declared copy constructor or a user-declared destructor. ...
Change in 12.8 class.copy paragraph 22:
If the class definition of a class X does not explicitly declare a move assignment operator, one will be implicitly declared as defaulted if and only if [ Example: ... ]
Insert a new section after section D.4 depr.register:
The implicit declaration of a copy constructor is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. The implicit declaration of a copy assignment operator is deprecated if the class has a user-declared copy constructor or a user-declared destructor. (12.4 class.dtor, 12.8 class.copy)