sol-prog/schm — Issue #2: Make it possible to derive from key classes.
Author: elfring
Created: 2011-11-24 20:42:14+00:00
State: open

I notice that some key classes do not have got a virtual destructor.

Examples:
- [Cell](https://github.com/sol-prog/schm/blob/16c86d86f07f6e15909f57667efc27ef54a48395/Cell.h)
- [Object](https://github.com/sol-prog/schm/blob/16c86d86f07f6e15909f57667efc27ef54a48395/Object.h)

This might indicate that the intended use is only for [value objects](http://en.wikipedia.org/wiki/Data_transfer_object "Data transfer object").

I imagine that they are also good candidates as base classes to improve their reuse. The addition of the key word "virtual" to these destructors will be required in this case.

See also:
- [C++ frequently answered questions](http://dietmar-kuehl.de/mirror/c++-faq/virtual-functions.html#faq-20.7 "When should my destructor be virtual?")
- "[Tip of the Day](http://www.devx.com/tips/Tip/14187 "What's Wrong with Inheriting from a Class that Has no Virtual Destructor?")"
- [Question/answer forum](http://stackoverflow.com/questions/270917/why-should-i-declare-a-virtual-destructor-for-an-abstract-class-in-c "Why should I declare a virtual destructor for an abstract class in C++?")
- [Weblogs forum](http://www.artima.com/forums/flat.jsp?forum=106&thread=107587 "Working Around Non-Virtual Destructors")