CellModules
Catch::Option< T > Class Template Reference

#include <catch.hpp>

Public Member Functions

 Option ()
 
 Option (T const &_value)
 
 Option (Option const &_other)
 
 ~Option ()
 
Optionoperator= (Option const &_other)
 
Optionoperator= (T const &_value)
 
void reset ()
 
T & operator* ()
 
T const & operator* () const
 
T * operator-> ()
 
const T * operator-> () const
 
valueOr (T const &defaultValue) const
 
bool some () const
 
bool none () const
 
bool operator! () const
 
 operator SafeBool::type () const
 

Private Attributes

T * nullableValue
 
char storage [sizeof(T)]
 

Detailed Description

template<typename T>
class Catch::Option< T >

Definition at line 2441 of file catch.hpp.

Constructor & Destructor Documentation

◆ Option() [1/3]

template<typename T >
Catch::Option< T >::Option ( )
inline

Definition at line 2443 of file catch.hpp.

◆ Option() [2/3]

template<typename T >
Catch::Option< T >::Option ( T const &  _value)
inline

Definition at line 2444 of file catch.hpp.

◆ Option() [3/3]

template<typename T >
Catch::Option< T >::Option ( Option< T > const &  _other)
inline

Definition at line 2447 of file catch.hpp.

◆ ~Option()

template<typename T >
Catch::Option< T >::~Option ( )
inline

Definition at line 2451 of file catch.hpp.

Member Function Documentation

◆ none()

template<typename T >
bool Catch::Option< T >::none ( ) const
inline

Definition at line 2485 of file catch.hpp.

◆ operator SafeBool::type()

template<typename T >
Catch::Option< T >::operator SafeBool::type ( ) const
inline

Definition at line 2488 of file catch.hpp.

◆ operator!()

template<typename T >
bool Catch::Option< T >::operator! ( ) const
inline

Definition at line 2487 of file catch.hpp.

◆ operator*() [1/2]

template<typename T >
T & Catch::Option< T >::operator* ( )
inline

Definition at line 2475 of file catch.hpp.

◆ operator*() [2/2]

template<typename T >
T const & Catch::Option< T >::operator* ( ) const
inline

Definition at line 2476 of file catch.hpp.

◆ operator->() [1/2]

template<typename T >
T * Catch::Option< T >::operator-> ( )
inline

Definition at line 2477 of file catch.hpp.

◆ operator->() [2/2]

template<typename T >
const T * Catch::Option< T >::operator-> ( ) const
inline

Definition at line 2478 of file catch.hpp.

◆ operator=() [1/2]

template<typename T >
Option & Catch::Option< T >::operator= ( Option< T > const &  _other)
inline

Definition at line 2455 of file catch.hpp.

◆ operator=() [2/2]

template<typename T >
Option & Catch::Option< T >::operator= ( T const &  _value)
inline

Definition at line 2463 of file catch.hpp.

◆ reset()

template<typename T >
void Catch::Option< T >::reset ( )
inline

Definition at line 2469 of file catch.hpp.

◆ some()

template<typename T >
bool Catch::Option< T >::some ( ) const
inline

Definition at line 2484 of file catch.hpp.

◆ valueOr()

template<typename T >
T Catch::Option< T >::valueOr ( T const &  defaultValue) const
inline

Definition at line 2480 of file catch.hpp.

Member Data Documentation

◆ nullableValue

template<typename T >
T* Catch::Option< T >::nullableValue
private

Definition at line 2493 of file catch.hpp.

◆ storage

template<typename T >
char Catch::Option< T >::storage[sizeof(T)]
private

Definition at line 2494 of file catch.hpp.


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