~/talk

Five Issues with std::expected and How to Fix Them

Talkat NDC TechTown 2025 · 2025-09-22..09-25· [rust]
links:none on file
slides:none on file

C++ std::expected currently allows value and error of the same type, mixes monadic and procedural APIs, lacks customization points for failed access, and misses convenient bind/applicative helpers; proposed fixes include restricting convertible types and using std::variant under the hood to simplify implementation, adding a customization point for value/error access, shipping built-in bind_back/front inside monadic operations to avoid extra captures, and offering an applicative apply/up and pipe-based unwrap for tests — a bespoke expected implementation with these features is already on GitHub and is used successfully in a context‑specific product.

AI-written summary · about

  1. 0:00Introduction
  2. 2:13Basic usage and monadic ops
  3. 6:50Under the hood of std::expected
  4. 12:32API duplication in monadic interfaces
  5. 17:48Missing error handling customization
  6. 23:34Bind back and bind front
  7. 31:09More monadic operations needed
  8. 39:20Future improvements and alternatives
  9. 43:59Q&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.