R
Richard Herring
E. Robert Tisdale said:This is generally bad advice.
It's generally safe advice.
Ignore it.
Ignore it when you can be certain of the consequences.
Don't define a virtual destructor unless you have a specific use for it.
.... such as the common operation of deleting polymorphic objects via a
pointer to base.
Generally, C++ functions shouldn't be destroying objects passed to them
by reference (or by reference through a pointer).
Non sequitur. *Something* has to destroy objects created by new, and if
the objects are being used polymorphically, that something probably
doesn't know the dynamic type of the thing pointed to.