#Copy and Swap idiom with inheritance

9 messages · Page 1 of 1 (latest)

drifting parcel
#

Hi, ive been doing the copy and swap and move and swap idiom and
making a unified assignment operator (move/copy) along with a move constructor. In my inheritance tree, there is an abstract class. Currently my unified operator takes things by value. Since this doesn't make sense with abstract classes, is it okay to just leave it out?
Should I even implement the copy ctor and move ctor?

gleaming cliffBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

drifting parcel
#

Essentially, is it okay if my base Abstract class does not have a assignment operator

fringe gate
#

Copy and swap doesn't work well with inheritance

#

swap(base, derived) boom

drifting parcel
#

rip lol. Thanks alot

#

i did it a different way where each swap function called the one above

#

but ill change it now probably

gleaming cliffBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.