If the class definition does not explicitly declare a copy assignment operator, one is declared implicitly. If
the class definition declares a move constructor or move assignment operator, the implicitly declared copy
assignment operator is defined as deleted; otherwise, it is defined as defaulted (8.4). The latter case is
deprecated if the class has a user-declared copy constructor or a user-declared destructor. The implicitly-
declared copy assignment operator for a class X will have the form
C++ |
1
| X& X::operator=(const X&) |
|
if
— each direct base class B of X has a copy assignment operator whose parameter is of type const B&,
const volatile B& or B, and
— for all the non-static data members of X that are of a class type M (or array thereof), each such class
type has a copy assignment operator whose parameter is of type const M&, const volatile M& or M.122
Otherwise, the implicitly-declared copy assignment operator will have the form