|
Marjoram
0.01
Library for Functional Programming in C++
|
Implementation of (safe) union of two types. More...
#include <eitherImpl.hpp>
Public Member Functions | |
| template<typename... Args> | |
| EitherImpl (LeftSide, Args &&... args) | |
| Construct containing left type. | |
| template<typename... Args> | |
| EitherImpl (RightSide, Args &&... args) | |
| Construct containing right type. | |
| ~EitherImpl () | |
| Destructor, calling destructor of contained type. | |
| EitherImpl (const EitherImpl &rhs) | |
| Copy constructor; Copies underlying value. | |
| EitherImpl (EitherImpl &&rhs) noexcept | |
| Move constructor; Moves underlying value. | |
| EitherImpl & | operator= (const EitherImpl &rhs) |
| Copy assignment operator; Copies underlying value. | |
| EitherImpl & | operator= (EitherImpl &&rhs) noexcept |
| Move assignment operator; Moves underlying value. | |
| Right_t & | asRight () |
| Returns stored B value. More... | |
| const Right_t & | asRight () const |
| Returns stored B value. More... | |
| Left_t & | asLeft () |
| Returns stored A value. More... | |
| const Left_t & | asLeft () const |
| Returns stored A value. More... | |
Protected Attributes | |
| EitherSide | side |
| Indicates whether this contains an A or a B. | |
Implementation of (safe) union of two types.
|
inline |
Returns stored A value.
Undefined behavior if this either does not contain a A.
|
inline |
Returns stored A value.
Undefined behavior if this either does not contain a A.
|
inline |
Returns stored B value.
Undefined behavior if this either does not contain a B.
|
inline |
Returns stored B value.
Undefined behavior if this either does not contain a B.