I understand that whenever a custom copy constructor or assignment operator is defined in a derived class, these methods must answer calls to the corresponding methods of the base class. Now I'm focused on move constructors. Suppose this is my move constructor. I have two ways to call the base class constructor. Taken from here
Derived(Derived&& d):Base(d) -->Form A {} Derived(Derived&& d):Base(std::move(d)) -->Form B {}
Now which method is correct. From my understanding and the last response to a message using form B, it would be dangerous and incorrect, since the object will be reset when the constructor of the derived class is called. However, formA invokes the copy constructor of the base class. It would be better to call FormA. Similarly, in a redirection assignment statement, it is better not to call the assignment operator of the base class, and then the base class.
source share