~/talk

Back to Basics: Exceptions

Talkat CppCon 2020 · 2020-09-14..09-18· [software-architecture]
slides:none on file

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

  1. 0:00Introduction
  2. 1:14The exception situation
  3. 4:29Performance and design issues
  4. 8:52Goal of the talk
  5. 10:04How exceptions work
  6. 13:35Best practices
  7. 18:47Working with exceptions
  8. 22:20Exception safety guarantees
  9. 26:07Writing exception-safe code
  10. 43:20The noexcept operator
  11. 50:26Failing cleanup functions
  12. 52:21Refactoring to safe code
  13. 57:24Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.