Article

How can I make it easier to use the helper class that lets me pass more than one parameter to co_await?

Not specified ·The Old New Thing ·Published 2026-11-13 ·5 min read

This article discusses how to simplify the use of a helper class for passing multiple parameters to co_await in C++. It introduces a method to create a more manageable interface for users.

From the article

Last time, we figured out how to pass more than one parameter to co_await by combining the multiple parameter into a single mega-parameter.

But having to name the mega-parameter is annoying. Sure, today we have widget_ with_ priority , and then we get gadget_ with_ timeout , and then doodad_ with_priority_ and_ timeout , and oh my goodness it’s out of control.

Instead of making the caller have to name the mega-parameter, we can create a helper method that produces it.


Share this resource


Discovered 2026-11-16 Source The Old New Thing Archive 2026-11 →