HikoGUI
A low latency retained GUI
|
#include <hikogui/dispatch/when_any.hpp>
Public Types | |
using | value_type = std::variant<variant_decay_t<await_resume_result_t<Ts>>...> |
Public Member Functions | |
when_any (Ts const &...args) noexcept | |
Construct a when_any object from the given awaitables. | |
when_any (when_any &&)=delete | |
when_any (when_any const &)=delete | |
when_any & | operator= (when_any &&)=delete |
when_any & | operator= (when_any const &)=delete |
constexpr bool | await_ready () noexcept |
void | await_suspend (std::coroutine_handle<> const &handle) noexcept |
value_type | await_resume () noexcept |
An awaitable that waits for any of the given awaitables to complete.
The return value of awaiting on when_any
is a std::variant
of the return values of the given awaitables. If an awaitable has void
as return type then it will be converted to a std::monotype
so that is can be used in the std::variant
.
The index()
of the std::variant
return type will match the index of the when_any()
constructor argument of the triggered awaitable.
Ts | Awaitable types. |
|
inlinenoexcept |
Construct a when_any
object from the given awaitables.
The arguments may be of the following types:
await_ready()
, await_suspend()
and await_resume()
.operator co_await()
member function.operator co_await()
free function.awaitable_cast
functor.others | The awaitable to wait for. |