|
| Either ()=delete |
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t<is_copyable()> >> |
| Either (const Either &other) |
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t<is_copyable()> >> |
Either & | operator= (const Either &other) |
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t<is_movable()> >> |
| Either (Either &&other) noexcept |
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t<is_movable()> >> |
Either & | operator= (Either &&other) noexcept |
|
bool | hasLeft () const |
| Determines whether or not LHS is the active alternative. More...
|
|
bool | hasRight () const |
| Determines whether or not RHS is the active alternative. More...
|
|
const Lhs & | getLeft () const |
| Attempts to get the LHS value. More...
|
|
const Rhs & | getRight () const |
| Attempts to get the RHS value. More...
|
|
template<class LeftVisitor , class RightVisitor > |
const Either & | visit (LeftVisitor visitLeft, RightVisitor visitRight) const |
| Visit this Either. More...
|
|
template<class LeftVisitor > |
const Either & | doIfLeft (LeftVisitor visitLeft) const |
| Execute a callback if LHS is the active alternative. More...
|
|
template<class RightVisitor > |
const Either & | doIfRight (RightVisitor visitRight) const |
| Execute a callback if RHS is the active alternative. More...
|
|
template<class NewLhs , class Mapper > |
Either< NewLhs, Rhs > | mapLeftTo (Mapper mapper) const |
| Maps the LHS if there's any. More...
|
|
template<class NewRhs , class Mapper > |
Either< Lhs, NewRhs > | mapRightTo (Mapper mapper) const |
| Maps the RHS if there's any. More...
|
|
template<class NewLhs , class NewRhs , class MapperLeft , class MapperRight > |
Either< NewLhs, NewRhs > | mapTo (MapperLeft mapLeft, MapperRight mapRight) const |
| Maps both alternatives. More...
|
|
Lhs | leftOr (const Lhs &defaultValue) const |
| Tries to get the LHS value and fallback to default if not. More...
|
|
Rhs | rightOr (const Rhs &defaultValue) const |
| Tries to get the RHS value and fallback to default if not. More...
|
|
|
template<class = scl::tools::meta ::enable_if_t< scl::tools::meta ::is_movable<Lhs>() >> |
| Either (lhs_tag, Lhs &&lhs) |
| Construct the LHS alternative (rvalue) More...
|
|
template<class = scl::tools::meta ::enable_if_t< scl::tools::meta ::is_copyable<Lhs>() >> |
| Either (lhs_tag, const Lhs &lhs) |
| Construct the LHS alternative (lvalue) More...
|
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t< scl::tools::meta ::is_movable<Rhs>() >>> |
| Either (rhs_tag, Rhs &&rhs) |
| Construct the RHS alternative (rvalue) More...
|
|
template<class = scl::tools::meta ::void_t< scl::tools::meta ::enable_if_t< scl::tools::meta ::is_copyable<Rhs>() >>> |
| Either (rhs_tag, const Rhs &rhs) |
| Construct the RHS alternative (lvalue) More...
|
|
template<class Lhs, class Rhs>
class scl::utils::Either< Lhs, Rhs >
Alternative type that stores one or the other.
- Template Parameters
-
Lhs | being the left value type |
Rhs | being the right value type |
- Warning
- Either defines move and/or copy semantics only if both the underlying types do so
Definition at line 22 of file Either.h.
template<class Lhs, class Rhs>
template<class NewLhs , class NewRhs , class MapperLeft , class MapperRight >
Maps both alternatives.
- Template Parameters
-
NewLhs | being the new LHS value type |
NewRhs | being the new RHS value type |
MapperLeft | being Lhs -> NewLhs |
MapperRight | being Rhs -> NewRhs |
- Parameters
-
mapLeft | being the LHS mapper function |
mapRight | being the RHS mapper function |
- Returns
- the mapped Either<NewLhs, NewRhs>
Definition at line 414 of file Either.h.