6#include <yaclib/config.hpp>
27 static_assert(
is_future_base_v<T>,
"WhenAny function Iterator must be point to some Future");
30 YACLIB_WARN(count < 2,
"Don't use combinators for zero or one futures");
53 static_assert(
is_future_base_v<T>,
"WhenAny function Iterator must be point to some Future");
70 constexpr std::size_t
kSize =
sizeof...(E);
71 static_assert(
kSize >= 2,
"WhenAny wants at least two futures");
Provides a mechanism to access the result of async operations.
Provides a mechanism to access the result of async operations.
static auto 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)
typename detail::FutureBaseTypes< T >::Error future_base_error_t
Contract< V, E > MakeContract()
Creates related future and promise.
auto WhenAny(It begin, std::size_t count)
Create Future that is ready when any of futures is ready.