7template <
typename V,
typename T>
9 static_assert(
Check<V>(),
"V should be valid");
10 static_assert(!std::is_same_v<V, typename T::Error>,
11 "V cannot be the same as the trait Error type, because callback dispatch would be ambiguous");
12 static_assert(std::is_copy_constructible_v<wrap_void_t<V>>,
"Result should be copyable");
24 return _core !=
nullptr;
27 template <
typename...
Args>
31 if constexpr (
sizeof...(Args) == 0) {
34 _core->Store(std::forward<Args>(
args)...);
44 std::move(*this).Set(
StopTag{});
A intrusive pointer to objects with an embedded reference count.
detail::SharedCorePtr< V, T > & GetCore() noexcept
SharedPromise(detail::SharedCorePtr< V, T > core) noexcept
Part of unsafe but internal API.
bool Valid() const noexcept
void Set(Args &&... args) &&
SharedPromise() noexcept=default
#define YACLIB_ASSERT(cond)
Contract< V, T > MakeContract()
Creates related future and promise.