The co_await Keyword

Understand the use of the 'co_await' keyword in C++20.

co_await eventually causes the execution of the coroutine to be suspended or resumed. The expression exp in co_await exp has to be a so-called awaitable expression, i.e. which must implement a specific interface, consisting of the three functions await_ready, await_suspend, and await_resume.

A typical use case for co_await is a server that waits for events.

Get hands-on with 1200+ tech skills courses.