COROIO: Self Class Reference
COROIO
 
Loading...
Searching...
No Matches
Self Class Reference

A minimal example of a coroutine "awaitable" object. More...

#include <promises.hpp>

Detailed Description

A minimal example of a coroutine "awaitable" object.

This structure stores a coroutine handle and demonstrates how a coroutine can be suspended and resumed.

Example Usage

// A simple coroutine that uses 'Self' as an awaitable:
std::coroutine_handle<> exampleCoroutine() {
// co_await our custom awaitable
auto handle = co_await Self{};
// 'handle' is a std::coroutine_handle to this coroutine.
// You can perform actions like handle.destroy(), handle.resume(), etc.
...
}
A minimal example of a coroutine "awaitable" object.
Note
Internally, it captures the coroutine handle in its await_suspend step.

The documentation for this class was generated from the following file: