[#gather] == cobalt/gather.hpp The `gather` function can be used to `co_await` multiple <> at once with cancellations being passed through. The function will gather all completion and return them as `system::result`, i.e. capture conceptions as values. One awaitable throwing an exception will not cancel the others. It can be called as a variadic function with multiple <> or as on a range of <>. [source,cpp] ---- cobalt::promise task1(); cobalt::promise task2(); cobalt::promise do_gather() { co_await cobalt::gather(task1(), task2()); // <1> std::vector> aws {task1(), task2()}; co_await cobalt::gather(aws); // <2> } ---- <1> Wait for a variadic set of <> <2> Wait for a vector of <> The `gather` will invoke the functions of the `awaitable` as if used in a `co_await` expression. .Signatures of gather [source, cpp] ---- extern promise pv1, pv2; std::tuple, system::result> r1 = co_await gather(pv1, pv2); std::vector> pvv; pmr::vector> r2 = co_await gather(pvv); extern promise pi1, pi2; std::tuple, system::result, system::result, system::result> r3 = co_await gather(pv1, pv2, pi1, pi2); std::vector> piv; pmr::vector> r4 = co_await gather(piv); ---- [#gather-outline] === Outline [source,cpp,subs=+quotes] ---- // Variadic gather template __awaitable__ gather(Promise && ... p); // Ranged gather template> __awaitable__ gather(PromiseRange && p); ----