Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

...

Based on the preceding effects, the following table distinguishes three kinds of exception safety guarantees in decreasing desirabilityguarantee from most to least desired:

Guarantee

Description

Example

Strong

The strong exception safety guarantee is a property of an operation such that, in addition to satisfying the basic exception safety guarantee, if the operation terminates by raising an exception, it has no observable effects on program state.

Strong Exception Safety

Basic

The basic exception safety guarantee is a property of an operation such that, if the operation terminates by raising an exception, it preserves program state invariants and prevents resource leaks.

Basic Exception Safety

None

Code that provides neither the strong nor the basic exception safety guarantee is not exception safe.

No Exception Safety

...