15template <
typename V,
typename E,
bool Lazy,
bool Shared>
23 template <
typename Promise>
26#if YACLIB_FINAL_SUSPEND_TRANSFER != 0
28#elif YACLIB_SYMMETRIC_TRANSFER != 0
39template <
bool Lazy,
bool Shared>
41 template <
typename V,
typename E>
45template <
typename V,
typename E,
bool Lazy,
bool Shared>
49template <
typename V,
typename E,
bool Lazy,
bool Shared>
52 static_assert(!
Lazy || !
Shared,
"Not supported");
61 }
else if constexpr (
Lazy) {
70 return yaclib_std::suspend_always{};
72 return yaclib_std::suspend_never{};
81 this->Store(std::current_exception());
84 template <
typename Value>
86 this->Store(std::forward<Value>(
value));
90 this->Store(std::in_place);
94 auto handle = yaclib_std::coroutine_handle<PromiseType>::from_promise(*
this);
117#if YACLIB_SYMMETRIC_TRANSFER != 0
128 [[
nodiscard]] InlineCore* Here(InlineCore& caller)
noexcept final {
133#if YACLIB_SYMMETRIC_TRANSFER != 0
134 [[
nodiscard]] yaclib_std::coroutine_handle<>
Next(InlineCore& caller)
noexcept final {
147template <
bool Lazy,
bool Shared>
148template <
typename V,
typename E>
Provides a mechanism to access the result of async operations.
A intrusive pointer to objects with an embedded reference count.
Provides a mechanism to schedule the some async operations TODO(MBkkt) add description.
auto get_return_object() noexcept
void return_value(Value &&value) noexcept(std::is_nothrow_constructible_v< Result< V, E >, Value && >)
void unhandled_exception() noexcept
void return_value(Unit) noexcept
auto initial_suspend() noexcept
Destroy final_suspend() noexcept
#define YACLIB_ASSERT(cond)
constexpr size_t kSharedRefWithFuture
std::conditional_t< Shared, AtomicCounter< SharedCore< V, E >, PromiseTypeDeleter< Lazy, Shared > >, OneCounter< UniqueCore< V, E >, PromiseTypeDeleter< Lazy, Shared > > > PromiseTypeBase
YACLIB_INLINE void Loop(InlineCore *prev, InlineCore *curr) noexcept
Contract< V, E > MakeContract()
Creates related future and promise.
YACLIB_INLINE auto await_suspend(yaclib_std::coroutine_handle< Promise > handle) const noexcept
constexpr void await_resume() const noexcept
constexpr bool await_ready() const noexcept
static void Delete(ResultCore< V, E > &core) noexcept