Sunshine master
Self-hosted game stream host for Moonlight.
util::Either< X, Y > Class Template Reference

Tagged storage for one of two possible value types. More...

#include <src/utility.h>

Inheritance diagram for util::Either< X, Y >:
[legend]
Collaboration diagram for util::Either< X, Y >:
[legend]

Public Member Functions

constexpr bool has_left () const
 Check whether left.
 
constexpr bool has_right () const
 Check whether right.
 
X & left ()
 Return the left-hand alternative held by the variant.
 
const X & left () const
 Return the left-hand alternative held by the variant.
 
Y & right ()
 Return the right-hand alternative held by the variant.
 
const Y & right () const
 Return the right-hand alternative held by the variant.
 

Detailed Description

template<class X, class Y>
class util::Either< X, Y >

Tagged storage for one of two possible value types.

Member Function Documentation

◆ has_left()

template<class X , class Y >
bool util::Either< X, Y >::has_left ( ) const
inlineconstexpr

Check whether left.

Returns
True when the comparison condition is satisfied.

◆ has_right()

template<class X , class Y >
bool util::Either< X, Y >::has_right ( ) const
inlineconstexpr

Check whether right.

Returns
True when the comparison condition is satisfied.

◆ left() [1/2]

template<class X , class Y >
X & util::Either< X, Y >::left ( )
inline

Return the left-hand alternative held by the variant.

Returns
Mutable reference to the left-hand alternative.

◆ left() [2/2]

template<class X , class Y >
const X & util::Either< X, Y >::left ( ) const
inline

Return the left-hand alternative held by the variant.

Returns
Const reference to the left-hand alternative.

◆ right() [1/2]

template<class X , class Y >
Y & util::Either< X, Y >::right ( )
inline

Return the right-hand alternative held by the variant.

Returns
Mutable reference to the right-hand alternative.

◆ right() [2/2]

template<class X , class Y >
const Y & util::Either< X, Y >::right ( ) const
inline

Return the right-hand alternative held by the variant.

Returns
Const reference to the right-hand alternative.

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