6#include <yaclib/config.hpp>
26 typename T =
typename std::iterator_traits<It>::value_type>
29 static_assert(
is_future_base_v<T>,
"WhenAll function Iterator must be point to some Future");
30 YACLIB_WARN(count < 2,
"Don't use combinators for one or zero futures");
33 using R = std::conditional_t<F == FailPolicy::None, Result<V, E>, V>;
48 typename T =
typename std::iterator_traits<It>::value_type>
51 static_assert(
is_future_base_v<T>,
"WhenAll function Iterator must be point to some Future");
68 constexpr std::size_t
kSize =
sizeof...(E);
69 static_assert(
kSize >= 2,
"WhenAll wants at least two futures");
71 using R = std::conditional_t<F == FailPolicy::None, Result<V, Error>, V>;
Provides a mechanism to access the result of async operations.
Provides a mechanism to access the result of async operations.
static std::pair< ResultPtr, AllCombinator * > Make(std::size_t count)
#define YACLIB_WARN(cond, message)
void WhenImpl(Combinator *combinator, It it, std::size_t count) noexcept
typename detail::FutureBaseTypes< T >::Value future_base_value_t
typename detail::Head< Args... >::Type head_t
FailPolicy
This Policy describe how algorithm interpret if Future will be fulfilled by fail (exception or error)
auto WhenAll(It begin, std::size_t count)
Create Future which will be ready when all futures are ready.
typename detail::FutureBaseTypes< T >::Error future_base_error_t
Contract< V, E > MakeContract()
Creates related future and promise.
OrderPolicy
This Policy describe how algorithm produce result.