C
coredumperror
Hi all you C++ gurus out there,
I've got what may be an unusual question. What's the best way to
get a shallow copy of a class that you've programmed to prevent
accidental shallow copying? I've got an operator= that does deep copy,
and a copy constructor that does deep copy... is there any way for me
to get a shallow copy without writing a function that maually copies
each member datum into an out parameter? I'd love to be able to just
return *this, but that'd invoke my deep copy constructor, which I don't
want. Any suggestions?
I've got what may be an unusual question. What's the best way to
get a shallow copy of a class that you've programmed to prevent
accidental shallow copying? I've got an operator= that does deep copy,
and a copy constructor that does deep copy... is there any way for me
to get a shallow copy without writing a function that maually copies
each member datum into an out parameter? I'd love to be able to just
return *this, but that'd invoke my deep copy constructor, which I don't
want. Any suggestions?