E-MailRelay
|
A class template like a simplified c++17 std::optional. More...
#include <goptional.h>
Public Member Functions | |
optional () noexcept(noexcept(T())) | |
Default constructor for no value. | |
optional (const T &) | |
Constructor for a defined value. More... | |
void | reset () |
Clears the value. More... | |
bool | has_value () const noexcept |
Returns true if a defined value. More... | |
operator bool () const noexcept | |
Returns true if a defined value. More... | |
const T & | value () const |
Returns the value. More... | |
T | value_or (const T &) const |
Returns the value or a default. More... | |
optional< T > & | operator= (const T &) |
Assignment for a defined value. More... | |
optional (const optional &)=default | |
optional (optional &&) noexcept=default | |
optional & | operator= (const optional &)=default |
optional & | operator= (optional &&) noexcept=default |
A class template like a simplified c++17 std::optional.
Definition at line 49 of file goptional.h.
|
explicit |
Constructor for a defined value.
Definition at line 96 of file goptional.h.
|
noexcept |
Returns true if a defined value.
Definition at line 109 of file goptional.h.
|
explicitnoexcept |
Returns true if a defined value.
Definition at line 115 of file goptional.h.
G::optional< T > & G::optional< T >::operator= | ( | const T & | t | ) |
Assignment for a defined value.
Definition at line 140 of file goptional.h.
void G::optional< T >::reset |
Clears the value.
Definition at line 103 of file goptional.h.
const T & G::optional< T >::value |
Returns the value.
Definition at line 121 of file goptional.h.
T G::optional< T >::value_or | ( | const T & | default_ | ) | const |
Returns the value or a default.
Definition at line 134 of file goptional.h.