Re:Pure virtual destructors in C++
by thought_alarm on Sunday November 14, 2010 @03:39PM
(#1904071)
> All of which is a workaround for the fact that there is no explicit way to declare a c++ class to be abstract-only.
Sure you can. Just put the word "Abstract" in the class name, and then every programmer who reads that class name will know that it's abstract. What more does one need?
That approach is much clearer than resorting to tricks like a pure virtual destructor. At the end of the day it's all about communicating design.
What happens if you do have shared logic to put in the abstract base class's destructor? It can't be pure virtual, and you're back to being able to instantiate your 'abstract' base class...