Explain how C++20 Coroutines work at a high level (Promises, Awaitables).

Last updated 21 June 2026

  • The promise type (found from the return type) defines lifecycle and result via hooks like get_return_object(), initial_suspend(), and final_suspend().

  • The coroutine frame stores parameters, locals, and the promise. A std::coroutine_handle can resume() or destroy() it.

  • co_await drives an awaitable through await_ready(), await_suspend(), and await_resume(). co_yield v is sugar for co_await promise.yield_value(v).

  • https://vorbrodt.blog/2023/06/09/yacrb-yet-another-coroutines-blog/
All C++ interview questions