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.
Share
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.