wibble  1.1
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
wibble::Maybe< T > Struct Template Reference

#include <maybe.h>

Inheritance diagram for wibble::Maybe< T >:
Inheritance graph
[legend]
Collaboration diagram for wibble::Maybe< T >:
Collaboration graph
[legend]

Public Member Functions

bool nothing () const
 
T & value ()
 
const T & value () const
 
 Maybe (bool n, const T &v)
 
 Maybe (const T &df=T())
 
 operator T () const
 
bool operator<= (const Maybe< T > &o) const
 
- Public Member Functions inherited from wibble::mixin::Comparable< Maybe< T > >
const Maybe< T > & cmpSelf () const
 
bool operator!= (const Maybe< T > &o) const
 
bool operator== (const Maybe< T > &o) const
 
bool operator< (const Maybe< T > &o) const
 
bool operator> (const Maybe< T > &o) const
 
bool operator>= (const Maybe< T > &o) const
 

Static Public Member Functions

static Maybe Just (const T &t)
 
static Maybe Nothing (const T &df=T())
 

Protected Attributes

bool m_nothing:1
 
m_value
 

Constructor & Destructor Documentation

◆ Maybe() [1/2]

template<typename T >
wibble::Maybe< T >::Maybe ( bool  n,
const T &  v 
)
inline

◆ Maybe() [2/2]

template<typename T >
wibble::Maybe< T >::Maybe ( const T &  df = T())
inline

Member Function Documentation

◆ Just()

template<typename T >
static Maybe wibble::Maybe< T >::Just ( const T &  t)
inlinestatic

◆ nothing()

template<typename T >
bool wibble::Maybe< T >::nothing ( ) const
inline

◆ Nothing()

template<typename T >
static Maybe wibble::Maybe< T >::Nothing ( const T &  df = T())
inlinestatic

◆ operator T()

template<typename T >
wibble::Maybe< T >::operator T ( ) const
inline

◆ operator<=()

template<typename T >
bool wibble::Maybe< T >::operator<= ( const Maybe< T > &  o) const
inline

◆ value() [1/2]

template<typename T >
T& wibble::Maybe< T >::value ( )
inline

◆ value() [2/2]

template<typename T >
const T& wibble::Maybe< T >::value ( ) const
inline

Member Data Documentation

◆ m_nothing

template<typename T >
bool wibble::Maybe< T >::m_nothing
protected

◆ m_value

template<typename T >
T wibble::Maybe< T >::m_value
protected

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