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

#include "either.h"

Public Types

using L_t = L
 
using R_t = R
 

Public Member Functions

 Either ()=delete
 
 Either (const L &l)
 
 Either (const R &r)
 
template<typename LPrime , typename RPrime , typename = EnableIf_t<std::is_convertible<LPrime, L>::value && std::is_convertible<RPrime, R>::value>>
 Either (const Either< LPrime, RPrime > &other)
 
 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
 
boost::optional< L > MaybeLeft () const
 
boost::optional< R > MaybeRight () const
 
boost::variant< L, R > AsVariant () const
 
template<typename F >
ToRight (F &&f) const
 

Static Public Member Functions

template<typename RNew >
static Either< L, RNew > FromMaybe (const boost::optional< RNew > &maybeRight, const L &left)
 
static Either Left (const L &l)
 
static Either Right (const R &r)
 
template<typename RNew >
static EnableIf_t<!std::is_convertible< RNew, R >::value, Either< L, RNew > > Right (const RNew &r)
 

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 LeechCraft::Util::Either< L, R >

Definition at line 43 of file either.h.

Member Typedef Documentation

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

Definition at line 52 of file either.h.

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

Definition at line 53 of file either.h.

Constructor & Destructor Documentation

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

Referenced by LeechCraft::Util::Either< L, R >::Either().

+ Here is the caller graph for this function:

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

Definition at line 57 of file either.h.

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

Definition at line 62 of file either.h.

template<typename L, typename R>
template<typename LPrime , typename RPrime , typename = EnableIf_t<std::is_convertible<LPrime, L>::value && std::is_convertible<RPrime, R>::value>>
LeechCraft::Util::Either< L, R >::Either ( const Either< LPrime, RPrime > &  other)
inline
template<typename L, typename R>
LeechCraft::Util::Either< L, R >::Either ( const Either< L, R > &  )
default
template<typename L, typename R>
LeechCraft::Util::Either< L, R >::Either ( Either< L, R > &&  )
default

Member Function Documentation

template<typename L, typename R>
boost::variant<L, R> LeechCraft::Util::Either< L, R >::AsVariant ( ) const
inline

Definition at line 118 of file either.h.

Referenced by LeechCraft::Util::Either< L, R >::Either().

+ Here is the caller graph for this function:

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

Definition at line 132 of file either.h.

References LeechCraft::Util::Either< L, R >::Left(), and LeechCraft::Util::Either< L, R >::Right().

+ Here is the call graph for this function:

template<typename L, typename R>
const L& LeechCraft::Util::Either< L, R >::GetLeft ( ) const
inline
template<typename L, typename R>
bool LeechCraft::Util::Either< L, R >::IsRight ( ) const
inline
template<typename L, typename R>
static Either LeechCraft::Util::Either< L, R >::Left ( const L &  l)
inlinestatic

Definition at line 139 of file either.h.

Referenced by LeechCraft::Util::Either< L, R >::FromMaybe().

+ Here is the caller graph for this function:

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

Definition at line 104 of file either.h.

References LeechCraft::Util::Either< L, R >::GetLeft(), and LeechCraft::Util::Either< L, R >::IsLeft().

+ Here is the call graph for this function:

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

Definition at line 111 of file either.h.

References LeechCraft::Util::Either< L, R >::GetRight(), and LeechCraft::Util::Either< L, R >::IsRight().

+ Here is the call graph for this function:

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

Referenced by LeechCraft::Util::Either< L, R >::Either().

+ Here is the caller graph for this function:

template<typename L, typename R>
Either& LeechCraft::Util::Either< L, R >::operator= ( Either< L, R > &&  )
default
template<typename L, typename R>
static Either LeechCraft::Util::Either< L, R >::Right ( const R &  r)
inlinestatic
template<typename L, typename R>
template<typename RNew >
static EnableIf_t<!std::is_convertible<RNew, R>::value, Either<L, RNew> > LeechCraft::Util::Either< L, R >::Right ( const RNew &  r)
inlinestatic

Definition at line 150 of file either.h.

References LeechCraft::Util::Either< L, R >::Right().

+ Here is the call graph for this function:

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

Definition at line 124 of file either.h.

References LeechCraft::Util::Either< L, R >::GetLeft(), LeechCraft::Util::Either< L, R >::GetRight(), and LeechCraft::Util::Either< L, R >::IsRight().

+ Here is the call graph for this function:

Friends And Related Function Documentation

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.

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: