1, Declare destructors virtual in polymorphic base classes
why ? because C++ specifies that when a derived class object is deleted through a pointer to a base class with a non-virtual destructor, results are undefined.What typically happens at runtime is that the derived part of the object is never destroyed
2, if a class is not intended to be a base class, making the destructor virtual is usually a bad idea.
why? if a class have virtual functions, it has extra overhead(vptr).
3, In fact, many people summarize the situation this way: declare a virtual destructor in a class if and only if that class contains at least one virtual function
4,Sometimes, however, you have a class that you'd like to be abstract, but you don't have any pure virtual functions.
solution: declare pure virtual destructor.
There is one twist, however you must provide a definition for the pure virtual destructor, or linker will complain.
5, Not all base classes are designed to be used polymorphically. Neither the standard string type, for example, nor the STL container typesare designed to be base classes at all, much less polymorphic ones.