tmc::spawn_tuple()#
tmc::spawn_tuple() produces an awaitable that supports HALO when used with Clang 20+ via the [[clang::coro_await_elidable_argument]] attribute.
For HALO to work, spawn_tuple() must be awaited directly as a prvalue in a co_await expression. Storing the result in a variable before awaiting prevents HALO from being applied.
// HALO: spawn_tuple() is directly awaited
auto results = co_await tmc::spawn_tuple(task_int(1), task_int(2));
// Non-HALO: spawn_tuple() stored in variable
auto spawned = tmc::spawn_tuple(task_int(3), task_int(4));
auto results = co_await std::move(spawned);
// Non-HALO: spawn_tuple() with run_on() customization - due to member
// function call, this cannot be elided
auto results = co_await tmc::spawn_tuple(task_int(3), task_int(4))
.run_on(tmc::current_executor());
Main Documentation#
For full documentation on tmc::spawn_tuple(), see tmc::spawn_tuple().