LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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 ()=delete
 
 Either (R &&r)
 
 Either (const R &r)
 
 Either (Left< void >, const L &l)
 
 Either (const L &l)
 
 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
 
const R & GetRight () const
 
std::optional< L > MaybeLeft () const
 
std::optional< R > MaybeRight () const
 
std::variant< L, R > AsVariant () const &
 
std::variant< L, R > AsVariant () &&
 
template<typename F>
ToRight (F &&f) const
 
template<typename F>
auto MapLeft (F &&f) const
 
template<typename F>
auto MapRight (F &&f) const
 

Static Public Member Functions

static auto EmbeddingLeft ()
 

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 41 of file either.h.

◆ R_t

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

Definition at line 42 of file either.h.

Constructor & Destructor Documentation

◆ Either() [1/9]

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

◆ Either() [2/9]

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

Definition at line 46 of file either.h.

◆ Either() [3/9]

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

Definition at line 51 of file either.h.

◆ Either() [4/9]

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() [5/9]

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

Definition at line 61 of file either.h.

◆ Either() [6/9]

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

Definition at line 66 of file either.h.

◆ Either() [7/9]

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() [8/9]

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

◆ Either() [9/9]

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

Member Function Documentation

◆ AsVariant() [1/2]

template<typename L, typename R>
std::variant< L, R > LC::Util::Either< L, R >::AsVariant ( ) &&
inline

Definition at line 126 of file either.h.

◆ AsVariant() [2/2]

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

Definition at line 121 of file either.h.

Referenced by LC::Util::Visit().

+ Here is the caller graph for this function:

◆ EmbeddingLeft()

template<typename L, typename R>
static auto LC::Util::Either< L, R >::EmbeddingLeft ( )
inlinestatic

Definition at line 154 of file either.h.

◆ GetLeft()

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

◆ GetRight()

◆ IsLeft()

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

Definition at line 83 of file either.h.

Referenced by LC::Util::InstanceFunctor< Either< L, R > >::Apply().

+ Here is the caller graph for this function:

◆ 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 140 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 147 of file either.h.

◆ MaybeLeft()

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

Definition at line 107 of file either.h.

◆ MaybeRight()

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

Definition at line 114 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 132 of file either.h.

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 171 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 166 of file either.h.


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