Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. (See strong exception safety.)

#Strong 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. (See basic exception safety.)

#Basic Basic Exception Safety

None

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

#No No Exception Safety

Code that provides no exception safety guarantee is unsafe and must be considered defective.

...

[CWE]CWE-390: Detection of Error Condition Without Action
CWE-460: Improper Cleanup on Thrown Exception
CWE-703: Failure to Handle Exceptional Conditions
CWE-754: Improper Check for Unusual or Exceptional Conditions
CWE-755: Improper Handling of Exceptional Conditions
[ISO/IEC 14882-2003] 
[MISRA 08]Rule 15-3-2
Rule 15-3-4
[Sutter 00]Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions
[Sutter 01]More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions

 

...