libcoro
1.0
Coroutine support library for C++20
|
Converts any result to awaitable object. More...
#include <make_awaitable.h>
Inherits std::suspend_never.
Converts any result to awaitable object.
This can be useful, when used in template coroutines, when caller supplies own function, which could be awaitable.
To use this class, you need to construct it inside of co_await expression
The object is constructed using the lambda expression, which must return whatever the user function returns. If the return value is not awaitable, you can still use co_await on the result.
If the user function is awaitable, then awaiter just proxies all three required methods to perform true co_await operation.
Fn |
Definition at line 28 of file make_awaitable.h.