LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::Either< typename, typename > Class Template Reference

#include "either.h"

+ Inheritance diagram for LC::Util::Either< typename, typename >:

Public Types

using L_t = L
 
using R_t = R
 

Public Member Functions

 Either ()=delete
 
 Either (const L &l)
 
 Either (R &&r)
 
 Either (const R &r)
 
 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
 

Static Public Member Functions

template<typename RNew >
static Either< L, RNew > FromMaybe (const std::optional< RNew > &maybeRight, const L &left)
 
static Either Left (const L &l)
 
static Either Right (R &&r)
 
static Either Right (const R &r)
 
template<typename... Vars>
static Either LeftLift (const std::variant< Vars... > &var)
 
template<typename... Vars>
static Either LeftLift (const Either< std::variant< Vars... >, R > &either)
 
template<typename LPrime , typename = std::enable_if_t<std::is_convertible_v<LPrime, L>>>
static Either LeftLift (const Either< LPrime, R > &either)
 
template<typename RNew >
static std::enable_if_t<!std::is_convertible< RNew, R >::value, Either< L, RNew > > Right (const RNew &r)
 
static auto EmbeddingLeft ()
 

Friends

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

Detailed Description

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

Definition at line 47 of file networkresult.h.

Member Typedef Documentation

◆ L_t

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

Definition at line 30 of file either.h.

◆ R_t

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

Definition at line 31 of file either.h.

Constructor & Destructor Documentation

◆ Either() [1/6]

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

◆ Either() [2/6]

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

Definition at line 35 of file either.h.

◆ Either() [3/6]

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

Definition at line 40 of file either.h.

◆ Either() [4/6]

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

Definition at line 45 of file either.h.

◆ Either() [5/6]

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

◆ Either() [6/6]

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

Member Function Documentation

◆ AsVariant() [1/2]

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

Definition at line 98 of file either.h.

◆ AsVariant() [2/2]

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

Definition at line 93 of file either.h.

◆ EmbeddingLeft()

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

Definition at line 162 of file either.h.

References LC::Util::Either< typename, typename >::Left(), and LC::Util::Either< typename, typename >::Right().

+ Here is the call graph for this function:

◆ FromMaybe()

template<typename , typename >
template<typename RNew >
static Either< L, RNew > LC::Util::Either< typename, typename >::FromMaybe ( const std::optional< RNew > & maybeRight,
const L & left )
inlinestatic

Definition at line 112 of file either.h.

References LC::Util::Either< typename, typename >::Left(), and LC::Util::Either< typename, typename >::Right().

+ Here is the call graph for this function:

◆ GetLeft()

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

◆ GetRight()

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

◆ IsLeft()

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

◆ IsRight()

◆ Left()

template<typename , typename >
static Either LC::Util::Either< typename, typename >::Left ( const L & l)
inlinestatic

◆ LeftLift() [1/3]

template<typename , typename >
template<typename LPrime , typename = std::enable_if_t<std::is_convertible_v<LPrime, L>>>
static Either LC::Util::Either< typename, typename >::LeftLift ( const Either< LPrime, R > & either)
inlinestatic

Definition at line 149 of file either.h.

References LC::Util::Either< typename, typename >::Left(), and LC::Util::Either< typename, typename >::Right().

+ Here is the call graph for this function:

◆ LeftLift() [2/3]

template<typename , typename >
template<typename... Vars>
static Either LC::Util::Either< typename, typename >::LeftLift ( const Either< std::variant< Vars... >, R > & either)
inlinestatic

◆ LeftLift() [3/3]

template<typename , typename >
template<typename... Vars>
static Either LC::Util::Either< typename, typename >::LeftLift ( const std::variant< Vars... > & var)
inlinestatic

Definition at line 135 of file either.h.

Referenced by LC::Util::Either< typename, typename >::LeftLift().

+ Here is the caller graph for this function:

◆ MaybeLeft()

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

Definition at line 79 of file either.h.

References LC::Util::Either< typename, typename >::GetLeft(), and LC::Util::Either< typename, typename >::IsLeft().

+ Here is the call graph for this function:

◆ MaybeRight()

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

Definition at line 86 of file either.h.

References LC::Util::Either< typename, typename >::GetRight(), and LC::Util::Either< typename, typename >::IsRight().

+ Here is the call graph for this function:

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Right() [1/3]

template<typename , typename >
static Either LC::Util::Either< typename, typename >::Right ( const R & r)
inlinestatic

Definition at line 129 of file either.h.

◆ Right() [2/3]

template<typename , typename >
template<typename RNew >
static std::enable_if_t<!std::is_convertible< RNew, R >::value, Either< L, RNew > > LC::Util::Either< typename, typename >::Right ( const RNew & r)
inlinestatic

Definition at line 157 of file either.h.

References LC::Util::Either< typename, typename >::Right().

+ Here is the call graph for this function:

◆ Right() [3/3]

◆ ToRight()

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

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 179 of file either.h.

◆ operator==

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

Definition at line 174 of file either.h.


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