~/talk

No Compiler Required - Hand-Rolling C++20 Coroutines in C++17

Talkat C++Now 2026 · 2026-05-04..05-08· [compilers-and-language-design]
links:none on file
slides:none on file

Shows how a C++20 coroutine body maps to a C++17 heapallocated state machine by generating concrete coroutine frames, explicit suspension-indexed switch labels, and manual lifetime management for locals and temporaries; implements symmetric transfer, initial/final_suspend semantics and exception-unwinding. Demonstrates a hand-rolled state machine lowered to C++17, a stackful alternative that matches handwritten iterator performance for simple generators, and an automated source-to-source rewriter built on LibTooling that produces working C++17 instantiations (demo compiles and runs under ASan).

AI-written summary · about

  1. 0:00Introduction
  2. 5:22C++20 coroutine overview
  3. 11:07Simple iota generator rewrite
  4. 23:56Coroutine handle class
  5. 31:25Coroutine frame setup
  6. 41:01Local variables in coroutines
  7. 57:39Exception handling
  8. 1:05:49Optimizing coroutines
  9. 1:16:30Automating coroutine rewrite
  10. 1:27:55Q&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.