|
libcaf
0.13.2
|
Represents an optional value of T.
More...
#include <optional.hpp>
Public Types | |
| using | type = T |
Typdef for T. | |
Public Member Functions | |
| optional (const none_t &=none) | |
Creates an empty instance with valid() == false. | |
| optional (T value) | |
Creates an valid instance from value. | |
| optional (const optional &other) | |
| optional (optional &&other) | |
| optional & | operator= (const optional &other) |
| optional & | operator= (optional &&other) |
| bool | valid () const |
| Queries whether this instance holds a value. | |
| bool | empty () const |
Returns !valid(). | |
| operator bool () const | |
Returns valid(). | |
| bool | operator! () const |
Returns !valid(). | |
| T & | operator* () |
| Returns the value. | |
| const T & | operator* () const |
| Returns the value. | |
| const T * | operator-> () const |
| Returns the value. | |
| T * | operator-> () |
| Returns the value. | |
| T & | get () |
| Returns the value. | |
| const T & | get () const |
| Returns the value. | |
| const T & | get_or_else (const T &default_value) const |
Returns the value if valid(), otherwise returns default_value. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class T , typename U > | |
| bool | operator== (const optional< T > &lhs, const optional< U > &rhs) |
| template<class T , typename U > | |
| bool | operator== (const optional< T > &lhs, const U &rhs) |
| template<class T , typename U > | |
| bool | operator== (const T &lhs, const optional< U > &rhs) |
| template<class T , typename U > | |
| bool | operator!= (const optional< T > &lhs, const optional< U > &rhs) |
| template<class T , typename U > | |
| bool | operator!= (const optional< T > &lhs, const U &rhs) |
| template<class T , typename U > | |
| bool | operator!= (const T &lhs, const optional< U > &rhs) |
| template<class T > | |
| bool | operator== (const optional< T > &val, const none_t &) |
| template<class T > | |
| bool | operator== (const none_t &, const optional< T > &val) |
| template<class T > | |
| bool | operator!= (const optional< T > &lhs, const none_t &rhs) |
| template<class T > | |
| bool | operator!= (const none_t &lhs, const optional< T > &rhs) |
| template<class T > | |
| std::string | to_string (const optional< T > &what) |
Represents an optional value of T.
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
1.8.9.1