7template <
typename V,
typename E>
9 static_assert(
Check<V>(),
"V should be valid");
10 static_assert(
Check<E>(),
"E should be valid");
11 static_assert(!std::is_same_v<V, E>,
"SharedFuture cannot be instantiated with same V and E, because it's ambiguous");
12 static_assert(std::is_copy_constructible_v<Result<V, E>>,
"Result should be copyable");
18 return _core !=
nullptr;
29 _core->Attach(std::move(
p));
36 _core->Attach(std::move(
p));
42 _core->Attach(std::move(
p));
Provides a mechanism to access the result of async operations.
Provides a mechanism to access the result of async operations.
A intrusive pointer to objects with an embedded reference count.
Encapsulated return value from caller.
SharedFuture(detail::SharedCorePtr< V, E > core) noexcept
Part of unsafe but internal API.
Future< V, E > GetFuture() const
FutureOn< V, E > GetFutureOn(IExecutor &e) const
bool Valid() const &noexcept
void Attach(Promise< V, E > &&p) const
Result< V, E > Get() const
#define YACLIB_ASSERT(cond)
Contract< V, E > MakeContract()
Creates related future and promise.