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

#include <hikogui/when_any.hpp>

Public Types

using result_type = std::variant<std::monostate, detail::when_any_result_element_t<Ts>...>
 
using awaiter_type = std::variant<std::monostate, Ts...>
 

Public Member Functions

 when_any_result (when_any_result const &) noexcept=default
 
 when_any_result (when_any_result &&) noexcept=default
 
when_any_resultoperator= (when_any_result const &) noexcept=default
 
when_any_resultoperator= (when_any_result &&) noexcept=default
 
template<std::size_t I, typename Awaiter , typename... Result>
 when_any_result (std::in_place_index_t< I >, Awaiter const &awaiter, Result &&...result) noexcept
 
bool timeout () const noexcept
 
std::size_t index () const noexcept
 The index of the awaitable that was triggered.
 
bool operator== (awaitable auto const &rhs) const noexcept
 Comparison to check if the awaitable was the one that triggered when_any.
 

Friends

template<typename T >
auto & get (when_any_result const &rhs) noexcept
 Get the value returned by the awaitable that triggered when_any.
 
template<std::size_t I>
auto & get (when_any_result const &rhs) noexcept
 Get the value returned by the awaitable that triggered when_any.
 

Detailed Description

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

Result of the when_any awaitable.

Member Function Documentation

◆ index()

template<bool HasTimeout, typename... Ts>
std::size_t v1::when_any_result< HasTimeout, Ts >::index ( ) const
inlinenoexcept

The index of the awaitable that was triggered.

Returns
The index of the argument of when_any(), this includes the timeout parameter.

◆ operator==()

template<bool HasTimeout, typename... Ts>
bool v1::when_any_result< HasTimeout, Ts >::operator== ( awaitable auto const & rhs) const
inlinenoexcept

Comparison to check if the awaitable was the one that triggered when_any.

Friends And Related Symbol Documentation

◆ get [1/2]

template<bool HasTimeout, typename... Ts>
template<typename T >
auto & get ( when_any_result< HasTimeout, Ts > const & rhs)
friend

Get the value returned by the awaitable that triggered when_any.

◆ get [2/2]

template<bool HasTimeout, typename... Ts>
template<std::size_t I>
auto & get ( when_any_result< HasTimeout, Ts > const & rhs)
friend

Get the value returned by the awaitable that triggered when_any.


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