~/talk

Expect the expected

Talkat CppCon 2018 · 2018-09-23..09-28· [c-and-cpp]
slides:none on file

Proposal and prototype for a discriminated-union error type that unifies local error returns and centralized exceptions by storing either the result or an explanatory error value. Uses expected<T> built on std::variant/union plus a bool flag, an unexpected wrapper to disambiguate error constructors, and a value() accessor that throws on demand while operator* is UB. Covers copy/move, a fragile swap requiring many SFINAE constraints, allows collecting exceptions without throwing, and notes measurable call-overhead when exceptions are enabled.

AI-written summary · about

  1. 0:00Unexpected St. Petersburg story
  2. 3:15Introducing Expected concept
  3. 13:11Designing error handling from scratch
  4. 20:39Problems with exceptions today
  5. 24:15Introducing std::expected
  6. 33:18Expected implementation details
  7. 41:55Swapping expected objects
  8. 47:16Typical usage examples
  9. 51:16Advantages of expected
  10. 52:01Q&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.