Apache Mesos
Public Member Functions | Static Public Member Functions | List of all members
Try< T, E > Class Template Reference

#include <try.hpp>

Public Member Functions

 Try (const T &t)
 
template<typename U , typename = typename std::enable_if< std::is_constructible<T, const U&>::value>::type>
 Try (const U &u)
 
 Try (const E &error)
 
 Try (T &&t)
 
 Try (const Try &that)=default
 
 Try (Try &&that)=default
 
 ~Try ()=default
 
Tryoperator= (const Try &that)=default
 
Tryoperator= (Try &&that)=default
 
bool isSome () const
 
bool isError () const
 
const T & get () const
 
T & get ()
 
const T * operator-> () const
 
T * operator-> ()
 
const std::conditional
< std::is_same< E, Error >
::value, std::string, E >
::type & 
error () const
 

Static Public Member Functions

static Try some (const T &t)
 
static Try error (const E &e)
 

Constructor & Destructor Documentation

template<typename T, typename E = Error>
Try< T, E >::Try ( const T &  t)
inline
template<typename T, typename E = Error>
template<typename U , typename = typename std::enable_if< std::is_constructible<T, const U&>::value>::type>
Try< T, E >::Try ( const U &  u)
inline
template<typename T, typename E = Error>
Try< T, E >::Try ( const E &  error)
inline
template<typename T, typename E = Error>
Try< T, E >::Try ( T &&  t)
inline
template<typename T, typename E = Error>
Try< T, E >::Try ( const Try< T, E > &  that)
default
template<typename T, typename E = Error>
Try< T, E >::Try ( Try< T, E > &&  that)
default
template<typename T, typename E = Error>
Try< T, E >::~Try ( )
default

Member Function Documentation

template<typename T, typename E = Error>
static Try Try< T, E >::error ( const E &  e)
inlinestatic
template<typename T, typename E = Error>
const std::conditional< std::is_same<E, Error>::value, std::string, E>::type& Try< T, E >::error ( ) const
inline
template<typename T, typename E = Error>
const T& Try< T, E >::get ( ) const
inline
template<typename T, typename E = Error>
T& Try< T, E >::get ( )
inline
template<typename T, typename E = Error>
bool Try< T, E >::isError ( ) const
inline
template<typename T, typename E = Error>
bool Try< T, E >::isSome ( ) const
inline
template<typename T, typename E = Error>
const T* Try< T, E >::operator-> ( ) const
inline
template<typename T, typename E = Error>
T* Try< T, E >::operator-> ( )
inline
template<typename T, typename E = Error>
Try& Try< T, E >::operator= ( const Try< T, E > &  that)
default
template<typename T, typename E = Error>
Try& Try< T, E >::operator= ( Try< T, E > &&  that)
default
template<typename T, typename E = Error>
static Try Try< T, E >::some ( const T &  t)
inlinestatic

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