In C++ destructors are called recursively for each ancestor class from which this class extends, beginning from the destructor of this class. Since destructor of class A - virtual, then during a deletion, it will call a destructor B, so that C ++ will call a destructor A. Although destructor ~A() is declared as pure virtual, it must be defined.
See the details on http://stackoverflow.com/questions/999340/question-about-pure-virtual-destructor.
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати