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>,
"Future 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");
24 return _core !=
nullptr;
27 template <
typename...
Args>
30 if constexpr (
sizeof...(Args) == 0) {
31 _core->Set(std::in_place);
33 _core->Set(std::forward<Args>(
args)...);
40 std::move(*this).Set(
StopTag{});
A intrusive pointer to objects with an embedded reference count.
void Set(Args &&... args) &&
bool Valid() const &noexcept
SharedPromise(detail::SharedCorePtr< V, E > core) noexcept
Part of unsafe but internal API.
SharedPromise() noexcept=default
#define YACLIB_ASSERT(cond)
Contract< V, E > MakeContract()
Creates related future and promise.