~/talk

Modern C++ Error Handling

Talkat CppCon 2024 · on Wednesday, 2024-09-18· at 16:45· Adams A, 6700 North Gaylord Rockies Boulevard· [developer-experience]
slides:none on file

Covers concrete choices not high-level promises: C++17 std::optional and C++23 std::expected with the Monadic Operations (transform and_then transform_error or_else) are shown in real code and compared to exceptions, boolean/error‑code returns, out‑params and globals. Examples include composing error returns with lambdas, a checked/unchecked policy (compile‑time template switch) and a correct‑by‑construction month type, plus a substitutable throwing violation handler for contracts and the checked/unchecked policy to defer who decides how to handle errors.

AI-written summary · about

  1. 0:00Introduction
  2. 1:47Why modern C++ error handling matters
  3. 3:56Disappointments vs logic errors
  4. 5:18Traditional error handling techniques
  5. 11:00Limitations of exceptions
  6. 12:46C++17 std::optional
  7. 13:52C++23 std::expected benefits
  8. 16:00Composition challenges with std::expected
  9. 18:52Immediately invoked lambdas
  10. 20:15Monadic operations in C++23
  11. 28:55Part two transition
  12. 29:16Invalid inputs with contracts
  13. 32:32Checked vs unchecked functions
  14. 34:43Policy-based error handling
  15. 37:13Correct by construction
  16. 40:00Contracts in C++
  17. 40:43C++26 contracts proposal
  18. 46:20Liskov rule and testing contracts
  19. 51:22Summary
  20. 52:46Q&A
~/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.