C++20 brings us coroutines and with them the power to create generators, iterables and ranges. We'll see how coroutines allow for cleaner, more readable, code, easier abstraction and genericity, composition and avoiding callbacks and inversion of control. We'll discuss the pains of writing iterator types with distributed internal state and old-school co-routines. Then we'll look at C++20 coroutines and how easy they are to write clean linear code. Coroutines prevent inversion of control and reduce callback hell. We'll see how they compose and play with Ranges with examples from math, filtering, rasterization. The talk will focus more on co_yield and less on co_await and async related usages.
Презентация