Back to Basics: Exceptions
summary
Explains why exceptions are widely banned and how to use them safely by showing concrete techniques: prefer RAII and unique_ptr for resource management, make move/swap/destructors noexcept, and implement the basic/strong/no-throw guarantees (no leaked resources, commit/rollback semantics, operations that cannot fail). Demonstrates the temporary move idiom to get strong safety for copy/assignment, how to refactor error-code APIs by wrapping new throwing interfaces with try/catch to preserve old contracts, and why throwing during stack unwinding or from destructors is catastrophic.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:14The exception situation
- 4:29Performance and design issues
- 8:52Goal of the talk
- 10:04How exceptions work
- 13:35Best practices
- 18:47Working with exceptions
- 22:20Exception safety guarantees
- 26:07Writing exception-safe code
- 43:20The noexcept operator
- 50:26Failing cleanup functions
- 52:21Refactoring to safe code
- 57:24Q&A session








