combines a set of futures into a single future that becomes ready when
all of the futures in the set become ready. For the
Concurrency TS version of this function, which includes an additional overload,
std::experimental::when_all function template and
std::experimental::when_all function template (iterator
template<typename ... FutureTypes> std::future<std::tuple<FutureTypes...> > when_all(FutureTypes&&... futures);
Each type in
is an instantiation of either
std::shared_future. For each
a call to
future which is an instantation of
std::future must be passed as
The supplied futures are transferred into internal storage. The asynchronous
result associated with each future is marked so that when all the
futures are ready the future returned from
when_all is ready.
If all the futures are already ready at the
point of the call, the returned future will also be ready.
> which becomes ready
when all of the supplied futures becomes ready.
When the future is ready, the stored value is
std::tuple holding the supplied
The marking of the individual futures as ready
synchronizes with any call to
get() on the returned future that sees
the result as ready.
std::bad_alloc if the required internal
storage cannot be allocated.
On compilers that don't support variadic templates, an overloaded set of function templates is provided that supports passing of up to 5 arguments.
On compilers that don't provide
jss::tuple is used instead. The macro
defined to either
jss::tuple as appropriate.