Each class controls what happens when we copy, move, assign, or destroy objects of its type. Special member functions—the copy constructor, move constructor, copy-assignment operator, move-assignment operator, and destructor—define these operations. The move constructor and move-assignment operator take a (usually non
const) rvalue reference; the copy versions take a (usually
const) ordinary lvalue reference.
If a class declares none of these operations, the compiler will define them automatically. If not defined as deleted, these operations memberwise initialize, move, assign, or destroy the object: Taking each non
static data member in turn, the synthesized operation does whatever is appropriate to the member’s type to move, ...