ledger-core
Public Types | Public Member Functions | Static Public Attributes | List of all members
ledger::core::Option< T > Class Template Reference

Public Types

typedef T BaseType
 

Public Member Functions

 Option (const T &value)
 
 Option (T &&value)
 
 Option (const Option< T > &option)
 
 Option (Option< T > &&option)
 
 Option (const std::experimental::optional< T > &optional)
 
Option< T > & operator= (const Option< T > &option)
 
Option< T > & operator= (Option< T > &&option)
 
Option< T > & operator= (const T &v)
 
Option< T > & operator= (T &&v)
 
Option< T > & operator= (T *v)
 
bool isEmpty () const
 
bool hasValue () const
 
bool nonEmpty () const
 
T & operator* () &
 
const T & operator* () const &
 
T && operator* () &&
 
const T && operator* () const &&
 
const T * operator-> () const
 
T * operator-> ()
 
T & getValue () &
 
const T & getValue () const &
 
T && getValue () &&
 
const T && getValue () const &&
 
getValueOr (const T &v) const &
 
getOrElse (std::function< T()> f) const
 
getValueOr (T &&v) const &
 
getValueOr (T &&v) &&
 
optional< T > toOptional () const
 
bool operator== (const T &v) const noexcept
 
bool operator== (const Option< T > &v) const noexcept
 
bool operator!= (const T &v) const noexcept
 
bool operator!= (const Option< T > &v) const noexcept
 
 operator bool () const
 
void foreach (std::function< void(const T &value)> f) const
 
bool forall (std::function< bool(const T &value)> f) const
 
template<typename A >
Option< A > map (std::function< A(const T &)> f) const
 
template<typename A >
Option< A > flatMap (std::function< Option< A >(const T &)> f) const
 
std::vector< T > toVector () const
 
template<typename A >
Option< A > orElse (std::function< Option< A >()> f) const
 
 operator optional< T > ()
 

Static Public Attributes

static const Option< T > NONE
 

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