diff --git a/async_simple/coro/Collect.h b/async_simple/coro/Collect.h index 157d80016..93e48e531 100644 --- a/async_simple/coro/Collect.h +++ b/async_simple/coro/Collect.h @@ -380,7 +380,7 @@ inline auto collectAllWindowedImpl(size_t maxConcurrency, output.push_back(std::move(t)); } if (yield) { - co_await Yield(); + co_await Yield{}; } } co_return std::move(output); diff --git a/async_simple/coro/Lazy.h b/async_simple/coro/Lazy.h index aa3cf029d..fc522223b 100644 --- a/async_simple/coro/Lazy.h +++ b/async_simple/coro/Lazy.h @@ -42,7 +42,7 @@ class Lazy; // execute, we could write: // // ```C++ -// co_await Yield(); +// co_await Yield{}; // ``` // // This would suspend the executing coroutine. diff --git a/docs/docs.cn/Lazy.md b/docs/docs.cn/Lazy.md index 37f16d764..e6ff9b811 100644 --- a/docs/docs.cn/Lazy.md +++ b/docs/docs.cn/Lazy.md @@ -291,7 +291,7 @@ RescheduleLazy和Lazy持有的LazyLocals为一个void*类型的指针,类型 # Yield 有时我们可能希望主动让出一个 Lazy 协程的执行,将执行资源交给其他任务。(例如我们发现当前协程执行的时间太长了) -我们可以通过在 Lazy 中 `co_await async_simple::coro::Yield();` 来做到这一点。 +我们可以通过在 Lazy 中 `co_await async_simple::coro::Yield{};` 来做到这一点。 # 获取当前调度器 diff --git a/docs/docs.en/Lazy.md b/docs/docs.en/Lazy.md index 78c59e7d0..e5a2831ce 100644 --- a/docs/docs.en/Lazy.md +++ b/docs/docs.en/Lazy.md @@ -290,7 +290,7 @@ If the user starts Lazy through 'start (callback)' and needs to recycle LazyLoca # Yield Sometimes we may want the executing Lazy to yield out. (For example, we found the Lazy has been executed for a long time) -We can yield it by `co_await async_simple::coro::Yield();` in the Lazy. +We can yield it by `co_await async_simple::coro::Yield{};` in the Lazy. # Get the Current Executor