fiber
Loading...
Searching...
No Matches
fiber::cAwaitable Concept Reference

Concept describeing the interface of an object that can be co_awaited. More...

#include <cAwaitable.hpp>

Concept definition

template<class Awaitable, class ResultType void>
concept fiber::cAwaitable = requires(Awaitable awaitable){
{ awaitable.await_ready() } -> std::convertible_to<bool>;
{ awaitable.await_resume() } -> std::same_as<ResultType>;
} && (
requires(Awaitable awaitable, std::coroutine_handle<CoroutinePromise<int>> handle){
{ awaitable.await_suspend(handle) } -> std::same_as<void>;
}
||
requires(Awaitable awaitable, std::coroutine_handle<CoroutinePromise<int>> handle){
{ awaitable.await_suspend(handle) } -> std::same_as<bool>;
}
)
Concept describeing the interface of an object that can be co_awaited.
Definition cAwaitable.hpp:23

Detailed Description

Concept describeing the interface of an object that can be co_awaited.

Implements the following functions:

  • bool await_ready()
  • ResultType await_resume()
  • void await_suspend(std::coroutine_handle<CoroutinePromise<T>>) or void await_suspend(std::coroutine_handle<CoroutinePromise<T>>)