LeechCraft  0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
LC::Util::Either< L, R > Class Template Reference

#include "either.h"

+ Inheritance diagram for LC::Util::Either< L, R >:

Public Types

using L_t = L
 
using R_t = R
 

Public Member Functions

 Either (FromStdExpected_t, std::expected< R, L > &&ex)
 
 Either ()=delete
 
 Either (R &&r)
 
 Either (const R &r)
 
 Either (Left< void >, const L &l)
 
 Either (const L &l) requires(!std
 
 Either (Left< L > &&left)
 
template<typename LL >
requires std::is_constructible_v< L, LL && > Either (Left< LL > &&left)
 
 Either (const Either &)=default
 
 Either (Either &&)=default
 
Eitheroperator= (const Either &)=default
 
Eitheroperator= (Either &&)=default
 
bool IsLeft () const
 
bool IsRight () const
 
const L & GetLeft () const
 
L & GetLeft ()
 
const R & GetRight () const
 
R & GetRight ()
 
std::optional< L > MaybeLeft () const
 
std::optional< R > MaybeRight () const
 
template<typename F >
ToRight (F &&f) const
 
template<typename F >
auto MapLeft (F &&f) const
 
template<typename F >
auto MapRight (F &&f) const
 

Friends

bool operator== (const Either &e1, const Either &e2)
 
bool operator!= (const Either &e1, const Either &e2)
 

Detailed Description

template<typename L, typename R>
class LC::Util::Either< L, R >

Definition at line 32 of file either.h.

Member Typedef Documentation

◆ L_t

template<typename L, typename R>
using LC::Util::Either< L, R >::L_t = L

Definition at line 36 of file either.h.

◆ R_t

template<typename L, typename R>
using LC::Util::Either< L, R >::R_t = R

Definition at line 37 of file either.h.

Constructor & Destructor Documentation

◆ Either() [1/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( FromStdExpected_t  ,
std::expected< R, L > &&  ex 
)
inline

Definition at line 39 of file either.h.

◆ Either() [2/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( )
delete

◆ Either() [3/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( R &&  r)
inline

Definition at line 46 of file either.h.

◆ Either() [4/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( const R &  r)
inline

Definition at line 51 of file either.h.

◆ Either() [5/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( Left< void >  ,
const L &  l 
)
inline

Definition at line 56 of file either.h.

◆ Either() [6/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( const L &  l)
inlineexplicit

Definition at line 61 of file either.h.

◆ Either() [7/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( Left< L > &&  left)
inline

Definition at line 66 of file either.h.

◆ Either() [8/10]

template<typename L, typename R>
template<typename LL >
requires std::is_constructible_v<L, LL&&> LC::Util::Either< L, R >::Either ( Left< LL > &&  left)
inline

Definition at line 73 of file either.h.

◆ Either() [9/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( const Either< L, R > &  )
default

◆ Either() [10/10]

template<typename L, typename R>
LC::Util::Either< L, R >::Either ( Either< L, R > &&  )
default

Member Function Documentation

◆ GetLeft() [1/2]

template<typename L, typename R>
const L& LC::Util::Either< L, R >::GetLeft ( ) const
inline

◆ GetLeft() [2/2]

template<typename L, typename R>
L& LC::Util::Either< L, R >::GetLeft ( )
inline

Definition at line 100 of file either.h.

◆ GetRight() [1/2]

template<typename L, typename R>
const R& LC::Util::Either< L, R >::GetRight ( ) const
inline

◆ GetRight() [2/2]

template<typename L, typename R>
R& LC::Util::Either< L, R >::GetRight ( )
inline

Definition at line 114 of file either.h.

◆ IsLeft()

template<typename L, typename R>
bool LC::Util::Either< L, R >::IsLeft ( ) const
inline

◆ IsRight()

template<typename L, typename R>
bool LC::Util::Either< L, R >::IsRight ( ) const
inline

◆ MapLeft()

template<typename L, typename R>
template<typename F >
auto LC::Util::Either< L, R >::MapLeft ( F &&  f) const
inline

Definition at line 142 of file either.h.

◆ MapRight()

template<typename L, typename R>
template<typename F >
auto LC::Util::Either< L, R >::MapRight ( F &&  f) const
inline

Definition at line 149 of file either.h.

◆ MaybeLeft()

template<typename L, typename R>
std::optional<L> LC::Util::Either< L, R >::MaybeLeft ( ) const
inline

Definition at line 121 of file either.h.

◆ MaybeRight()

template<typename L, typename R>
std::optional<R> LC::Util::Either< L, R >::MaybeRight ( ) const
inline

Definition at line 128 of file either.h.

◆ operator=() [1/2]

template<typename L, typename R>
Either& LC::Util::Either< L, R >::operator= ( const Either< L, R > &  )
default

◆ operator=() [2/2]

template<typename L, typename R>
Either& LC::Util::Either< L, R >::operator= ( Either< L, R > &&  )
default

◆ ToRight()

template<typename L, typename R>
template<typename F >
R LC::Util::Either< L, R >::ToRight ( F &&  f) const
inline

Definition at line 136 of file either.h.

Friends And Related Function Documentation

◆ operator!=

template<typename L, typename R>
bool operator!= ( const Either< L, R > &  e1,
const Either< L, R > &  e2 
)
friend

Definition at line 160 of file either.h.

◆ operator==

template<typename L, typename R>
bool operator== ( const Either< L, R > &  e1,
const Either< L, R > &  e2 
)
friend

Definition at line 155 of file either.h.


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