~/talk

Back to Basics: Exception Handling and Exception Safety

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
name:Ben Saks
links:none on file
slides:none on file

Explains concrete rules: throw objects by value and catch by reference, prefer std::exception subclasses like std::out_of_range, and use RAII to close files during stack unwinding. Shows a file example where G throws a catastrophic_failure and how calling G first and staging results in locals gives the strong guarantee (commit/rollback). Recommends making destructors, operator delete and swap noexcept, demonstrates swap-based commit to implement strong safety, and contrasts table‑based vs dynamic registration exception implementations for performance.

AI-written summary · about

  1. 0:00Introduction to exceptions
  2. 7:20Why exception handling
  3. 13:04Throwing and catching exceptions
  4. 23:48Exception safety guarantees
  5. 30:14RAII and resource management
  6. 46:07When to use exceptions
  7. 56:45Exceptions in practice
~/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.