LatticeHashForest
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
lhf::Optional< T > Class Template Reference

Describes an optional value of some type T. The value may either be present or absent. More...

#include <lhf.hpp>

Public Member Functions

 Optional (const T &value)
 
bool is_present ()
 Informs if the value is present.
 
const T & get ()
 Gets the underlying value. Throws an exception if it is absent.
 

Static Public Member Functions

static Optional absent ()
 Explicitly creates an absent value.
 

Detailed Description

template<typename T>
class lhf::Optional< T >

Describes an optional value of some type T. The value may either be present or absent.

Template Parameters
TThe type.

Definition at line 91 of file lhf.hpp.

Constructor & Destructor Documentation

◆ Optional()

template<typename T >
lhf::Optional< T >::Optional ( const T &  value)
inline

Definition at line 96 of file lhf.hpp.

Member Function Documentation

◆ absent()

template<typename T >
static Optional lhf::Optional< T >::absent ( )
inlinestatic

◆ get()

template<typename T >
const T & lhf::Optional< T >::get ( )
inline

Gets the underlying value. Throws an exception if it is absent.

Definition at line 109 of file lhf.hpp.

◆ is_present()

template<typename T >
bool lhf::Optional< T >::is_present ( )
inline

Informs if the value is present.

Definition at line 104 of file lhf.hpp.


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