1.2.3.2 Rules of implicitly declare
  • The Default ctor, will not be implicitly generated if:
    1. you have explicitly declared any constructor. Compiler doesn’t create a default constructor if we write any constructor even if it is copy constructor.
    2. There is a member in your class that is not default-constructible (such as a reference, a const object, or a class with no or inaccessible default constructor)
    3. (C++11) you have explicitly told the compiler to not generate one using A() = delete;
  • The copy ctor, will not be implicitly generated if:
    1. you have explicitly declared a copy constructor (for class X a constructor taking X, X& or const X&)
    2. there is a member in your class that is not copy-constructible (such as a class with no or inaccessible copy constructor)
    3. (C++11) you have explicitly told the compiler to not generate one using A(const A&) = delete;
  • The Copy Assignment Operator will not be implicitly generated if
    1. you have explicitly declared a copy-assignment operator (for class X an operator = taking X, X& or const X&) )
    2. there is a member in your class that is not assignable (such as a reference, a const object or a class with no or inaccessible assignment operator)
    3. (C++11) you have explicitly told the compiler to not generate one using A& operator=(const A&) = delete;
  • The Destructor will not be implicitly generated if
    1. you have explicitly declared a destructor
    2. (C++11) you have explicitly told the compiler to not generate one using  A() = delete;
  • The Move Constructor or Move Operator(C++11) will not be implicitly generated if
    1. you have explicitly declared a move constructor or move assignment(for class X, a constructor taking X&&)
    2. there is a member in your class that cannot be moved (have deleted, inaccessible, or ambiguous)
    3. you have defined a copy assignment operator, copy constructor, destructor, or move assignment operator
    4. you have explicitly told the compiler to not generate one using A(A&&) = delete;
  • The Move Assignment Operator (C++11) will not be implicitly generated if
    1. you have explicitly declared a move assignment operator (for class X, an operator = taking X&&)
    2. you have defined a copy assignment operator, copy constructor, destructor, or move constructor
    3. you have explicitly told the compiler to not generate one using A& operator=(A&&) = delete;
  • The justification is that declaring a copy operation (conāĂŘstruction or assignment) indicates that the normal approach to copying an object(memberwise copy) isn’t appropriate for the class, and compilers figure that if memberwise copy isn’t appropriate for the copy operations, memberwise move probably isn’t appropriate for the move operations.
  • The same idea as the previous item, declaring a move operation (construction or assignment) in a class causes compilers to disable the copy operations.
  • The two copy operations are independent: declaring one doesn’t prevent compilers from generating the other. The two move operations are not independent. If you declare either, that prevents compilers from generating the other.
  • C++11 deprecates the automatic generation of copy operations for classes declaring copy operations or a destructor. This means that if you have code that depends on the generation of copy operations in classes declaring a destructor or one of the copy operations, you should consider upgrading these classes to eliminate the dependence. Provided the behavior of the compiler-generated functions is correct (i.e, if memberwise copying of the class’s non-static data members is what you want), your job is easy, because C++11’s "= default" lets you say that explicitly:
  • If you declared a destructor, implicitly defaulted copy member are deprecated.
    PIC
  • A summary can be seen blow
    PIC