How can I make it easier to use the helper class that lets me pass more than one parameter to co_await?
Permanent link:
cppdashboard.dev/r/2026/11/how-can-i-make-it-easier-to-use-the-helper-class-that-lets-mThis 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