<html>
<head>
<title>Tightening the conditions for generating implicit moves</title>

<style type="text/css">
  ins { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  del { text-decoration:line-through; background-color:#FFA0A0 }
</style>
</head>

<body>
Jens Maurer<br/>
2010-11-11<br/>
N3203=10-0193

<h1>Tightening the conditions for generating implicit moves</h1>

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

<p>
Change in 12.8 class.copy paragraph 8:
<blockquote>
If the class definition does not explicitly declare a copy
constructor<ins>, </ins><del>and</del> there is no user-declared move
constructor,<ins> and there is no user-declared move assignment
operator,</ins> a copy constructor is implicitly declared as defaulted
(<del>8.4 dcl.fct.def</del> <ins>8.4.2 dcl.fct.def.default</ins>).
<ins>Such implicit declaration is deprecated if the class has a
user-declared copy assignment operator or a user-declared
destructor.</ins> ...
</blockquote>


Change in 12.8 class.copy paragraph 10:
<blockquote>
If the <del>class</del> definition <ins>of a class X</ins> does not
explicitly declare a move constructor, one will be implicitly declared
as defaulted if and only
if
<ul>
<li>X does not have a user-declared copy constructor<ins>,</ins>
<del>and</del></li>
<li><ins>X does not have a user-declared copy assignment operator,</ins></li>
<li><ins>X does not have a user-declared move assignment operator,</ins></li>
<li><ins>X does not have a user-declared destructor, and</ins></li>
<li>the move constructor would not be implicitly defined as deleted.</li>
</ul>
</blockquote>

Change in 12.8 class.copy paragraph 20:
<blockquote>
If the class definition does not explicitly declare a copy assignment
operator<ins>, there is no user-declared move constructor,</ins> and
there is no user-declared move assignment operator, a copy assignment
operator is implicitly
declared as defaulted (<del>8.4 dcl.fct.def</del> <ins>8.4.2
dcl.fct.def</ins>). <ins>Such implicit declaration is deprecated if
the class has a user-declared copy constructor or a user-declared
destructor.</ins> ...
</blockquote>


Change in 12.8 class.copy paragraph 22:
<blockquote>
If the <del>class</del> definition <ins>of a class X</ins> does not
explicitly declare a move assignment operator, one will be implicitly
declared as defaulted if and only if
<ul>
<li><ins>X does not have a user-declared copy constructor,</ins></li>
<li><ins>X does not have a user-declared move constructor,</ins></li>
<li><del>the</del> <ins>X does not have a user-declared</ins> copy
assignment operator<del> is not user-declared and</del><ins>,</ins></li>
<li><ins>X does not have a user-declared destructor, and</ins></li>
<li>the move assignment operator would not be implicitly defined as
deleted.</li>
</ul>
[ Example: ... ]
</blockquote>

Insert a new section after section D.4 depr.register:
<blockquote>
<ins>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)</ins>
</blockquote>

</body>
</html>
