The Default ctor, will not be implicitly generated if:
you have explicitly declared any constructor. Compiler doesn’t
create a default constructor if we write any constructor even if it
is copy constructor.
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)
(C++11) you have explicitly told the compiler to not generate one
using A() = delete;
The copy ctor, will not be implicitly generated if:
you have explicitly declared a copy constructor (for class X a
constructor taking X, X& or const X&)
there is a member in your class that is not copy-constructible (such
as a class with no or inaccessible copy constructor)
(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
you have explicitly declared a copy-assignment operator (for class
X an operator = taking X, X& or const X&) )
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)
(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
you have explicitly declared a destructor
(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
you have explicitly declared a move constructor or move
assignment(for class X, a constructor taking X&&)
there is a member in your class that cannot be moved (have
deleted, inaccessible, or ambiguous)
you have defined a copy assignment operator, copy constructor,
destructor, or move assignment operator
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
you have explicitly declared a move assignment operator (for class
X, an operator = taking X&&)
you have defined a copy assignment operator, copy constructor,
destructor, or move constructor
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.