When a class has many data members, it is hard to figure out whether a data member is copied or not in its copy constructor.
Is there a solution?
A simple solution is to make sure every member type is copyable, and that there are e.g. no pointers to self or other pointers or references that require fix-ups. Then the generated copy-constructor is good enough.
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