LeviLamina
Loading...
Searching...
No Matches
YieldAwaiter.h
1
#pragma once
2
3
#include <coroutine>
4
5
#include "ll/api/coro/Executor.h"
6
7
namespace
ll::coro {
8
constexpr
inline
struct
Yield
{
9
} yield;
10
class
YieldAwaiter
{
11
ExecutorRef
exec;
12
13
public
:
14
constexpr
YieldAwaiter
(
ExecutorRef
exec =
nullptr
) : exec(exec) {}
15
16
constexpr
void
setExecutor(
ExecutorRef
ex) { exec = ex; }
17
18
constexpr
bool
await_ready()
const
noexcept
{
return
false
; }
19
void
await_suspend(std::coroutine_handle<> handle) { exec->execute(handle); }
20
constexpr
void
await_resume()
const
noexcept
{}
21
};
22
}
// namespace ll::coro
ll::coro::YieldAwaiter
Definition
YieldAwaiter.h:10
optional_ref
Definition
optional_ref.h:10
ll::coro::Yield
Definition
YieldAwaiter.h:8
src
ll
api
coro
YieldAwaiter.h
Generated on Sat Apr 26 2025 05:55:20 for LeviLamina by
1.12.0