Embedded Template Library 1.0
etl::optional< T, true > Class Template Reference

#include <optional.h>

Public Member Functions

ETL_CONSTEXPR14 optional ()
 Constructor.
 
ETL_CONSTEXPR14 optional (etl::nullopt_t)
 Constructor with nullopt.
 
ETL_CONSTEXPR14 optional (const optional &other)
 Copy constructor.
 
ETL_CONSTEXPR14 optional (const T &value_)
 Constructor from value type.
 
ETL_CONSTEXPR14 optionaloperator= (etl::nullopt_t)
 Assignment operator from nullopt.
 
ETL_CONSTEXPR14 optionaloperator= (const optional &other)
 Assignment operator from optional.
 
ETL_CONSTEXPR14 optionaloperator= (const T &value_)
 Assignment operator from value type.
 
ETL_CONSTEXPR14 T * operator-> ()
 Pointer operator.
 
ETL_CONSTEXPR14 const T * operator-> () const
 Pointer operator.
 
ETL_CONSTEXPR14 T & operator* () ETL_LVALUE_REF_QUALIFIER
 Dereference operator.
 
ETL_CONSTEXPR14 const T & operator* () const ETL_LVALUE_REF_QUALIFIER
 Dereference operator.
 
ETL_CONSTEXPR14 ETL_EXPLICIT operator bool () const
 Bool conversion operator.
 
ETL_CONSTEXPR14 bool has_value () const ETL_NOEXCEPT
 
ETL_CONSTEXPR14 T & value () ETL_LVALUE_REF_QUALIFIER
 Get a reference to the value.
 
ETL_CONSTEXPR14 const T & value () const ETL_LVALUE_REF_QUALIFIER
 Get a const reference to the value.
 
ETL_CONSTEXPR14 T value_or (const T &default_value) const ETL_LVALUE_REF_QUALIFIER
 Gets the value or a default if no valid.
 
ETL_CONSTEXPR14 void swap (optional &other)
 Swaps this value with another.
 
ETL_CONSTEXPR14 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)
 

Detailed Description

template<typename T>
class etl::optional< T, true >

For POD types.

Template Parameters
TThe type to store.

Member Function Documentation

◆ emplace() [1/4]

template<typename T >
template<typename T1 >
void etl::optional< T, true >::emplace ( const T1 &  value1)
inline

Emplaces a value. 1 parameter.

◆ emplace() [2/4]

template<typename T >
template<typename T1 , typename T2 >
void etl::optional< T, true >::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, true >::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, true >::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: