View on GitHub

talks

home

CppCon 2022

Understanding C++ coroutines by example,
part 2: generators

Coroutines are a powerful tool added to C++20. There are no out-of-the-box facilities in the standard library that are user friendly and immediately usable, although there are plenty of libraries out there already providing such primitives.

Also there are now best practices regarding usage of coroutines in C++ that emerged while people were learning them, and that programmers should know about.

This time we will concentrate on the generators part of the coroutines.
We’ll get up to speed with how coroutines work under the hood, and then learn about the co_yield keyword, and how simple generators and asynchronous generators conceptually work.

Video
hour 1: https://www.youtube.com/watch?v=lm10Cj-HNKQ
hour 2: https://www.youtube.com/watch?v=lz3F036_OvU

Description on the conference site:
https://cppcon.digital-medium.co.uk/session/2022/understanding-cpp-coroutines-by-example-1/

Slides: