A virtual destructor ensures a C++ object will correctly call the destructor of the most-derived class when a polymorphic object is deleted through a pointer to its base class.
I've just updated GCC from (I think) 4.5.6 to 4.6.1, under Windows, MinGW. Suddenly my NonInstantiable base class (from which you inherit …
c++ gcc c++11 virtual-destructorI want to inherit from std::map, but as far as I know std::map hasn't any virtual destructor. Is …
c++ inheritance stdmap virtual-destructor/*Child is inherited from Parent*/ class Parent { public: Parent () //Constructor { cout << "\n Parent constructor called\n" << …
c++ inheritance protected virtual-destructorIf I define a class like this: class A{ public: A(){} virtual ~A(){} virtual void func(){} }; Does it mean that …
c++ class inline virtual-destructorUPD. There is a mark that it is a duplicate of this question. But in that question OP asks HOW …
c++ language-lawyer pure-virtual virtual-destructor