boost::capy::this_coro::executor

Tag object that yields the current executor when awaited.

Synopsis

inline constexpr executor_tag executor = {};

Description

Use co_await this_coro::executor inside a coroutine whose promise type supports executor access (e.g., inherits from io_awaitable_promise_base). The returned executor reflects the executor this coroutine is bound to.

Example

task<void> example()
{
    executor_ref ex = co_await this_coro::executor;
}

Behavior

  • If no executor was set, returns a default‐constructed `executor_ref` (where `operator bool()` returns `false`).

  • This operation never suspends; `await_ready()` always returns `true`.

See Also

executor_tag

io_awaitable_promise_base

Created with MrDocs