How can I pass more than one parameter to co_await?

· Raymond Chen · Nov. 12, 2026, 10:33 p.m.
Summary
This blog post addresses the common problem of passing multiple parameters to the `co_await` operator in C++ coroutines. It explains that the `co_await` operator can only take one parameter and offers a workaround by wrapping the awaitable object and its additional parameters into a single new awaitable object. This solution allows developers to make use of extra parameters such as priority within the `await_suspend` method. The post delves into the implementation details with code examples. It also hints at further discussions on improving this technique in subsequent posts.