HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
v1::when_any< HasTimeout, Ts > Class Template Reference

#include <hikogui/when_any.hpp>

Public Types

using value_type = when_any_result<HasTimeout, Ts...>
 

Public Member Functions

 when_any (awaitable auto &&...others) noexcept
 Construct a when_any object from the given awaitables.
 
template<typename Rep , typename Period >
 when_any (std::chrono::duration< Rep, Period > timeout, awaitable auto &&...others) noexcept
 Construct a when_any object from the given awaitables.
 
 when_any (when_any &&)=delete
 
 when_any (when_any const &)=delete
 
when_anyoperator= (when_any &&)=delete
 
when_anyoperator= (when_any const &)=delete
 
constexpr bool await_ready () noexcept
 
void await_suspend (std::coroutine_handle<> const &handle) noexcept
 
value_type await_resume () noexcept
 

Detailed Description

template<bool HasTimeout, typename... Ts>
class v1::when_any< HasTimeout, Ts >

An awaitable that waits for any of the given awaitables to complete.

Constructor & Destructor Documentation

◆ when_any() [1/2]

template<bool HasTimeout, typename... Ts>
v1::when_any< HasTimeout, Ts >::when_any ( awaitable auto &&... others)
inlinenoexcept

Construct a when_any object from the given awaitables.

The arguments may be of the following types:

  • An object which can be directly used as an awaitable. Having the member functions: await_ready(), await_suspend() and await_resume() and was_triggered().
  • An object that has a operator co_await() member function.
  • An object that has a operator co_await() free function.
Parameters
othersThe awaitable to wait for.

◆ when_any() [2/2]

template<bool HasTimeout, typename... Ts>
template<typename Rep , typename Period >
v1::when_any< HasTimeout, Ts >::when_any ( std::chrono::duration< Rep, Period > timeout,
awaitable auto &&... others )
inlinenoexcept

Construct a when_any object from the given awaitables.

The arguments may be of the following types:

  • An object which can be directly used as an awaitable. Having the member functions: await_ready(), await_suspend() and await_resume() and was_triggered().
  • An object that has a operator co_await() member function.
  • An object that has a operator co_await() free function.
Parameters
othersThe awaitable to wait for.

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