Item-7 Declare destructor virtual in polymorphic base classes
· β 3 min read
If a class has any virtual functions (for polymorphic purpose), it should have a virtual destructor.
If a class has any virtual functions (for polymorphic purpose), it should have a virtual destructor.
Declare unwanted member functions private without implementations to disallow functionality automatically provided by compilers.
Compilers may implicitly generate their own versions of default constructor, copy constructor, copy assignment operator, and destructor.