“Coroutines: what can't they do?”
summary
The C++ Coroutines TS (N4680) adds three keywords and customization points and the talk shows how the compiler transforms coroutines into a coroutine state, a promise type and a coroutine handle. Examples include a lazy result type that uses co_return and initial_suspend to avoid work, an optional/expected style await_transform that lets co_await unwrap failures, and a type‑erased callable built from coroutine yield_value. Implementations exist in MSVC and Clang 5+ and libraries like cppcoro provide task/generator primitives; slides and code are on GitHub.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:25What are we talking about?
- 1:18What's that talking about?
- 2:05A coroutine is a generalization of a function
- 5:24Very simple coroutine
- 7:07Coroutine body transformation
- 10:33Coroutine state
- 15:39for co_await transformation
- 17:02Coroutine handle
- 18:37Return values
- 19:43Implementation for lazy 2in
- 24:44Lazy sequences aka generators
- 27:16Async generators
- 29:35Some operations returning optional
- 34:26I want to play with optional coroutines
- 38:43Summary
related talks
01h 16mC++ Feature Coroutines, Beginner Friendly
01h 01mUnderstanding C++ Coroutines by Example, Part 1
58m“Introduction to C++ Coroutines"
01h 20mCoroutines for Dummies
01h 06mC++ Coroutines from scratch
01h 26mC++ Coroutines - Don’t Try This at Home
45mCoroutines: Kotlin Versus
41mCoroutines explained by example
