What are the different categories of exception safety guarantees (no-throw, strong, basic)?

Last updated 21 June 2026

  • No-throw: the operation never fails and is marked noexcept. It is required of destructors, swap and moves.

  • Strong (commit-or-rollback): on throw, state is exactly as before the call. It is typically implemented with copy-and-swap (work on a copy, then a noexcept swap).

  • Basic: on throw, nothing leaks and invariants hold, but the state is valid yet unspecified. This is the minimum acceptable level (no guarantee is broken code).

  • https://github.com/25-masik-52/CppInterviewKit
All C++ interview questions