I have a class with about 50 members. 1 of them is a pointer. So, naturally I have to make my own copy constructor, copy everything and create a new instance of that object. My question is: Is there a shortcut or some special way I can have everything copied (like the default copy constructor does) then just handle that one pointer? Rather than manually copying each member.
I'd wrap your pointer into a helper class that does the copy in the way you like. That way you can leave the big class with the default copy ctor.
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