Category Archives: C++

Image

C++: the good parts

c++-the-good-parts

Why C++ is not my favourite programming language

Ahem.

The body of a destructor is executed before the destructors for member objects. Destructors for nonstatic member objects are executed before the destructors for base classes. Destructors for nonvirtual base classes are executed before destructors for virtual base classes. Destructors for nonvirtual base classes are executed in reverse order of their declaration in the derived class. Destructors for virtual base classes are executed in the reverse order of their appearance in a depth-first left-to-right traversal of the directed acyclic graph of base classes; “left-to-right” is the order of appearance of the base class names in the declaration of the derived class.

— Bjarne Stroustrup, The C++ reference manual, section 12.4.

Case closed.