Effective C++:条款07:为多态基类声明virtual析构函数 (Declare destructors virtual in polymorphic base classes.)

polymorphic(带多态性质的)base classes应该声明一个virtual析构函数。如果class带有任何virtual函数,它就应该拥有一个virtual析构函数。

Classes的设计目的如果不是作为base classes使用,或不是为了具备多态性(polymorphically),就不应该声明virtual析构函数。

---------------------------------------------------------------------------
You got a dream
You gotta protect it
People can't do something themselves
They wanna tell you you can do it
If you want something
Go get it
原文地址:https://www.cnblogs.com/elite/p/1997290.html