O'Reilly logo

Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions by Herb Sutter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Exception Safety: Is It Worth It?

Difficulty: 7

Is it worth the effort to write exception-safe code? This should no longer be a seriously disputed and debated point… but sometimes it still is.

Solution

The Abrahams Guarantees

  1. Recap: Briefly define the Abrahams exception safety guarantees (basic, strong, and nofail).

The basic guarantee says that failed operations might alter program state, but no leaks occur and affected objects/modules are still destructible and usable, in a consistent (but not necessarily predictable) state.

The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required