dune-functions
2.5.0
|
A wrapper that can either contain an object of T or be empty. More...
#include <dune/functions/common/optional.hh>
Public Member Functions | |
Optional () | |
Default constructor. More... | |
template<class TT , disableCopyMove< Optional, TT > = 0> | |
Optional (TT &&t) | |
Construct internal T from given argument. More... | |
Optional (Optional &&other) | |
Move constructor. More... | |
Optional (const Optional &other) | |
Copy constructor. More... | |
~Optional () | |
Destructor. More... | |
template<class TT , disableCopyMove< Optional, TT > = 0> | |
Optional & | operator= (TT &&t) |
Assignment. More... | |
Optional & | operator= (const Optional &other) |
Copy assignment from optional. More... | |
Optional & | operator= (Optional &&other) |
Move assignment from optional. More... | |
operator bool () const | |
Check if *this is not emtpy. More... | |
const T & | value () const |
Get reference to internal T. More... | |
T & | value () |
Get mutable reference to internal T. More... | |
template<class... Args> | |
void | emplace (Args &&... args) |
Construct internal T from given arguments. More... | |
void | release () |
Destruct internal T leaving *this in empty state. More... | |
A wrapper that can either contain an object of T or be empty.
T | Type of wrapped objects |
|
inline |
Default constructor.
|
inline |
Construct internal T from given argument.
|
inline |
Move constructor.
|
inline |
Copy constructor.
|
inline |
Destructor.
|
inline |
Construct internal T from given arguments.
|
inlineexplicit |
Check if *this is not emtpy.
|
inline |
Assignment.
If internal T exists, this does an assignement from argument, otherwise a construction.
|
inline |
Copy assignment from optional.
|
inline |
Move assignment from optional.
|
inline |
Destruct internal T leaving *this in empty state.
|
inline |
Get reference to internal T.
|
inline |
Get mutable reference to internal T.