Public Member Functions | List of all members
optionalData< T > Class Template Reference

A simplified version of std::optional (c++17), with much simpler construction semantics. More...

Public Member Functions

 optionalData (const optionalData< T > &)=default
 
 optionalData (optionalData< T > &&)=default
 
optionalData< T > & operator= (const optionalData< T > &)=default
 
optionalData< T > & operator= (optionalData< T > &&)=default
 
 optionalData ()
 
 optionalData (const T &val)
 
 optionalData (T &&val)
 
bool has_value () const noexcept
 
Tvalue () noexcept
 
const Tvalue () const noexcept
 
const Tvalue_or (const T &deflt) const
 
 operator bool () const noexcept
 
const Toperator* () const noexcept
 
Toperator* () noexcept
 
void operator= (const T &val)
 
void operator= (T &&val)
 

Detailed Description

template<class T>
class Foam::optionalData< T >

A simplified version of std::optional (c++17), with much simpler construction semantics.

Definition at line 41 of file optionalData.H.

Constructor & Destructor Documentation

◆ optionalData() [1/5]

optionalData ( const optionalData< T > &  )
default

◆ optionalData() [2/5]

optionalData ( optionalData< T > &&  )
default

◆ optionalData() [3/5]

optionalData ( )
inline

Definition at line 72 of file optionalData.H.

◆ optionalData() [4/5]

optionalData ( const T val)
inline

Definition at line 79 of file optionalData.H.

◆ optionalData() [5/5]

optionalData ( T &&  val)
inline

Definition at line 86 of file optionalData.H.

Member Function Documentation

◆ operator=() [1/4]

optionalData<T>& operator= ( const optionalData< T > &  )
default

◆ operator=() [2/4]

optionalData<T>& operator= ( optionalData< T > &&  )
default

◆ has_value()

bool has_value ( ) const
inlinenoexcept

Definition at line 96 of file optionalData.H.

◆ value() [1/2]

T& value ( )
inlinenoexcept

Definition at line 102 of file optionalData.H.

◆ value() [2/2]

const T& value ( ) const
inlinenoexcept

Definition at line 108 of file optionalData.H.

◆ value_or()

const T& value_or ( const T deflt) const
inline

Definition at line 114 of file optionalData.H.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Definition at line 123 of file optionalData.H.

◆ operator*() [1/2]

const T& operator* ( ) const
inlinenoexcept

Definition at line 129 of file optionalData.H.

◆ operator*() [2/2]

T& operator* ( )
inlinenoexcept

Definition at line 135 of file optionalData.H.

◆ operator=() [3/4]

void operator= ( const T val)
inline

Definition at line 141 of file optionalData.H.

◆ operator=() [4/4]

void operator= ( T &&  val)
inline

Definition at line 148 of file optionalData.H.


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