...
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. | |
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. | |
None | Code that provides neither the strong nor the basic exception safety guarantee is not exception safe. |
...