#include <optional.h>
|
| optional () |
| Constructor.
|
|
| optional (etl::nullopt_t) |
| Constructor with nullopt.
|
|
| optional (const optional &other) |
| Copy constructor.
|
|
| optional (const T &value_) |
| Constructor from value type.
|
|
| ~optional () |
| Destructor.
|
|
optional & | operator= (etl::nullopt_t) |
| Assignment operator from nullopt.
|
|
optional & | operator= (const optional &other) |
| Assignment operator from optional.
|
|
optional & | operator= (const T &value_) |
| Assignment operator from value type.
|
|
T * | operator-> () |
| Pointer operator.
|
|
const T * | operator-> () const |
| Pointer operator.
|
|
T & | operator* () |
| Dereference operator.
|
|
const T & | operator* () const |
| Dereference operator.
|
|
ETL_EXPLICIT | operator bool () const |
| Bool conversion operator.
|
|
ETL_CONSTEXPR bool | has_value () const ETL_NOEXCEPT |
|
T & | value () |
| Get a reference to the value.
|
|
const T & | value () const |
| Get a const reference to the value.
|
|
T | value_or (T default_value) const |
| Gets the value or a default if no valid.
|
|
void | swap (optional &other) |
| Swaps this value with another.
|
|
void | reset () |
| Reset back to invalid.
|
|
template<typename T1 > |
void | emplace (const T1 &value1) |
|
template<typename T1 , typename T2 > |
void | emplace (const T1 &value1, const T2 &value2) |
|
template<typename T1 , typename T2 , typename T3 > |
void | emplace (const T1 &value1, const T2 &value2, const T3 &value3) |
|
template<typename T1 , typename T2 , typename T3 , typename T4 > |
void | emplace (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4) |
|
template<typename T>
class etl::optional< T >
An optional type. If the optional type is not initialised then a type is not constructed. See http://en.cppreference.com/w/cpp/utility/optional
- Template Parameters
-
◆ emplace() [1/4]
template<typename T >
template<typename T1 >
Emplaces a value. 1 parameter.
◆ emplace() [2/4]
template<typename T >
template<typename T1 , typename T2 >
void etl::optional< T >::emplace |
( |
const T1 & |
value1, |
|
|
const T2 & |
value2 |
|
) |
| |
|
inline |
Emplaces a value. 2 parameters.
◆ emplace() [3/4]
template<typename T >
template<typename T1 , typename T2 , typename T3 >
void etl::optional< T >::emplace |
( |
const T1 & |
value1, |
|
|
const T2 & |
value2, |
|
|
const T3 & |
value3 |
|
) |
| |
|
inline |
Emplaces a value. 3 parameters.
◆ emplace() [4/4]
template<typename T >
template<typename T1 , typename T2 , typename T3 , typename T4 >
void etl::optional< T >::emplace |
( |
const T1 & |
value1, |
|
|
const T2 & |
value2, |
|
|
const T3 & |
value3, |
|
|
const T4 & |
value4 |
|
) |
| |
|
inline |
Emplaces a value. 4 parameters.
The documentation for this class was generated from the following file: