boost::capy::this_coro
Namespace for coroutine environment accessors.
Description
The this_coro namespace contains tag objects that can be awaited to retrieve information about the current coroutine's execution context. These tags are intercepted by a promise type's await_transform to yield the appropriate values without suspending.
Example
task<void> example()
{
auto const& env = co_await this_coro::environment;
auto ex = co_await this_coro::executor;
auto token = co_await this_coro::stop_token;
auto* alloc = co_await this_coro::allocator;
}
Types
Name |
Description |
Tag type for coroutine allocator retrieval. |
|
Tag type for coroutine environment retrieval. |
|
Tag type for coroutine executor retrieval. |
|
Tag type for coroutine stop token retrieval. |
Variables
Name |
Description |
Tag object that yields the current frame allocator when awaited. |
|
Tag object that yields the current environment when awaited. |
|
Tag object that yields the current executor when awaited. |
|
Tag object that yields the current stop token when awaited. |
See Also
io_awaitable_promise_base, io_env
Created with MrDocs