Local variables are different from parameters in C++ coroutines

1 · Raymond Chen · Oct. 13, 2021, 2:21 p.m.
In C++, you generally think of parameters and local variables as equivalent. A parameter behaves like a conveniently-initialized local variable.¹ But not for coroutines. Let’s look at one of the early steps of the coroutine transformation again: return_type MyCoroutine(args...) { create coroutine state copy parameters to coroutine frame promise_type p; The post Local variables are different from parameters in C++ coroutines appeared first on The Old New Thing....