if default copy constructor provider by compiler only make a shallow copy(copy the pointer of a member in heap to target object's corresponding member field), what is the difference between default copy constructor and default move constructor?
I think default move constructor should not be more more efficient than default copy constructor, as no deep copy happened. Am I right?
what is the difference between default copy constructor and default move constructor?
A default copy constructor does memberwise copy of the data members while a default move constructor does memberwise move of the data members. That is, the default move constructor steal resources instead of copying them from the passed argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With