Skip to content

Appearance Quote by Bjarne Stroustrup

“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.” quote by Bjarne Stroustrup
Download Open image
“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.”

Bjarne Stroustrup

About This Quote

Source Book: The C++ Programming Language, 4th edition, 2013

Destructors for virtual bases run in reverse order of a depth‑first left‑to‑right traversal of the inheritance graph.

In simple terms: Virtual base destructors run opposite to their appearance order.

Key Takeaway

Understand and respect the order when designing class hierarchies.

Themes

C++ inheritance resource management

Mood

technical analytical

Type

educational reference

When to use this quote

  • Implementing polymorphic libraries
  • debugging destructor crashes
  • ensuring proper resource release

Key Concepts

Object‑oriented design deterministic cleanup

Questions to Reflect On

  • How does this order affect resource deallocation?
  • When might you need to override this behavior?
A Different Perspective

If multiple inheritance is deep, the order can be hard to predict, leading to subtle bugs.

3.5 out of 5 (10 ratings)

More by Bjarne Stroustrup

Explore all 58 Bjarne Stroustrup quotes

More Appearance quotes

Browse all 2,365 Appearance quotes