The rule of 5 and inheritance
Last week, we talked about the rule of five and we discovered what it means for move operations if we only declare a destructor and not the rest of the special member functions. In that case, move operations are not declared, any move would automatically downgraded to a copy. You might say that it doesn’t happen often that you only declare a destructor without the others and if it is so, you should either remove it or declare the rest. However, there is one very common scenario in C++ that requires our attention. I’ve seen plenty of classes like these…
Sandor Dargo’s Blog