I am trying to understand the behaviour of auto-generated compiler code for various functions such as:
- destructor
- copy constructor
- assignment operator
- move constructor
- move assignment operator
Will declaring them with "= default" cause any functional difference compared to non-declared case? Does the answer of this question differ among the above listed functions? If there is no functional difference, what are the consequences of using either case?
Copy constructor declared with "= default"
class MyClass
{
public:
MyClass();
MyClass(MyClass &other) = default;
OtherClass some_member;
};
Copy constructor not declared:
class MyClass
{
public:
MyClass();
OtherClass some_member;
};