Loading...
Searching...
No Matches
optional.h File Reference
`#include "platform.h"`
`#include "alignment.h"`
`#include "error_handler.h"`
`#include "exception.h"`
`#include "initializer_list.h"`
`#include "memory.h"`
`#include "placement_new.h"`
`#include "type_traits.h"`
`#include "utility.h"`
`#include "private/diagnostic_uninitialized_push.h"`
`#include "private/diagnostic_pop.h"`

Go to the source code of this file.

## Classes

class | etl::nullopt_t
class | etl::optional_exception
class | etl::optional_invalid
class | etl::private_optional::optional_impl< T, false >
union | etl::private_optional::optional_impl< T, false >::storage_type::union_type
class | etl::private_optional::optional_impl< T, true >
class | etl::optional< T >

## Namespaces

namespace | etl

## Macros

#define | ETL_OPTIONAL_ENABLE_CPP14 typename etl::enable_if< etl::is_pod<typename etl::remove_cv<U>::type>::value, int>::type = 0
#define | ETL_OPTIONAL_ENABLE_CPP20_STL typename etl::enable_if< !etl::is_pod<typename etl::remove_cv<U>::type>::value, int>::type = 0
#define | ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 ETL_CONSTEXPR14 typename etl::enable_if< etl::is_pod<typename etl::remove_cv<T>::type>::value, bool>::type
#define | ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL

## Functions

template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator== (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Equality operator. cppreference 1.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator== (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Equality operator. cppreference 1.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator!= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Inequality operator. cppreference 2.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator!= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Inequality operator. cppreference 2.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator< (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Less than operator. cppreference 3.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator< (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Less than operator. cppreference 3.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator<= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Less than equal operator. cppreference 4.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator<= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| Less than equal operator. cppreference 4.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator> (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| greater than operator. cppreference 5
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator> (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| greater than operator. cppreference 5
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator>= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| greater than equal operator. cppreference 6
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator>= (const etl::optional< T > &lhs, const etl::optional< T > &rhs)
| greater than equal operator. cppreference 6
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator== (const etl::optional< T > &lhs, etl::nullopt_t)
| Equality operator. cppreference 7.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator== (const etl::optional< T > &lhs, etl::nullopt_t)
| Equality operator. cppreference 7.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator== (etl::nullopt_t, const etl::optional< T > &rhs)
| Equality operator. cppreference 8.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator== (etl::nullopt_t, const etl::optional< T > &rhs)
| Equality operator. cppreference 8.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator!= (const etl::optional< T > &lhs, etl::nullopt_t)
| Inequality operator. cppreference 9.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator!= (const etl::optional< T > &lhs, etl::nullopt_t)
| Inequality operator. cppreference 9.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator!= (etl::nullopt_t, const etl::optional< T > &rhs)
| Inequality operator. cppreference 10.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator!= (etl::nullopt_t, const etl::optional< T > &rhs)
| Inequality operator. cppreference 10.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator< (const etl::optional< T > &, etl::nullopt_t)
| Less than operator. cppreference 11.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator< (const etl::optional< T > &, etl::nullopt_t)
| Less than operator. cppreference 11.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator< (etl::nullopt_t, const etl::optional< T > &rhs)
| Less than operator. cppreference 12.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator< (etl::nullopt_t, const etl::optional< T > &rhs)
| Less than operator. cppreference 12.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator<= (const etl::optional< T > &lhs, etl::nullopt_t)
| Less than equal operator. cppreference 13.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator<= (const etl::optional< T > &lhs, etl::nullopt_t)
| Less than equal operator. cppreference 13.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator<= (etl::nullopt_t, const etl::optional< T > &)
| Less than equal operator. cppreference 14.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator<= (etl::nullopt_t, const etl::optional< T > &)
| Less than equal operator. cppreference 14.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator> (const etl::optional< T > &lhs, etl::nullopt_t)
| Greater than operator. cppreference 15.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator> (const etl::optional< T > &lhs, etl::nullopt_t)
| Greater than operator. cppreference 15.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator> (etl::nullopt_t, const etl::optional< T > &)
| Greater than operator. cppreference 16.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator> (etl::nullopt_t, const etl::optional< T > &)
| Greater than operator. cppreference 16.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator>= (const etl::optional< T > &, etl::nullopt_t)
| Greater than equal operator. cppreference 17.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator>= (const etl::optional< T > &, etl::nullopt_t)
| Greater than equal operator. cppreference 17.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator>= (etl::nullopt_t, const etl::optional< T > &rhs)
| Greater than equal operator. cppreference 18.
template<typename T>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator>= (etl::nullopt_t, const etl::optional< T > &rhs)
| Greater than equal operator. cppreference 18.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator== (const etl::optional< T > &lhs, const U &rhs)
| Equality operator. cppreference 19.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator== (const etl::optional< T > &lhs, const U &rhs)
| Equality operator. cppreference 19.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator!= (const etl::optional< T > &lhs, const U &rhs)
| Inequality operator. cppreference 21.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator!= (const etl::optional< T > &lhs, const U &rhs)
| Inequality operator. cppreference 21.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator== (const U &lhs, const etl::optional< T > &rhs)
| Equality operator. cppreference 20.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator== (const U &lhs, const etl::optional< T > &rhs)
| Equality operator. cppreference 20.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator!= (const U &lhs, const etl::optional< T > &rhs)
| Inequality operator. cppreference 22.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator!= (const U &lhs, const etl::optional< T > &rhs)
| Inequality operator. cppreference 22.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator< (const etl::optional< T > &lhs, const U &rhs)
| Less than operator. cppreference 23.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator< (const etl::optional< T > &lhs, const U &rhs)
| Less than operator. cppreference 23.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator< (const U &lhs, const etl::optional< T > &rhs)
| Less than operator. cppreference 24.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator< (const U &lhs, const etl::optional< T > &rhs)
| Less than operator. cppreference 24.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator<= (const etl::optional< T > &lhs, const U &rhs)
| Less than equal operator. cppreference 25.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator<= (const etl::optional< T > &lhs, const U &rhs)
| Less than equal operator. cppreference 25.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator<= (const U &lhs, const etl::optional< T > &rhs)
| Less than equal operator. cppreference 26.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator<= (const U &lhs, const etl::optional< T > &rhs)
| Less than equal operator. cppreference 26.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator> (const etl::optional< T > &lhs, const U &rhs)
| Greater than operator. cppreference 27.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator> (const etl::optional< T > &lhs, const U &rhs)
| Greater than operator. cppreference 27.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator> (const U &lhs, const etl::optional< T > &rhs)
| Greater than operator. cppreference 28.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator> (const U &lhs, const etl::optional< T > &rhs)
| Greater than operator. cppreference 28.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator>= (const etl::optional< T > &lhs, const U &rhs)
| Greater than equal operator. cppreference 29.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator>= (const etl::optional< T > &lhs, const U &rhs)
| Greater than equal operator. cppreference 29.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14 | etl::operator>= (const U &lhs, const etl::optional< T > &rhs)
| Greater than equal operator. cppreference 30.
template<typename T, typename U>
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL | etl::operator>= (const U &lhs, const etl::optional< T > &rhs)
| Greater than equal operator. cppreference 30.
template<typename T>
ETL_CONSTEXPR20_STL etl::optional< typename etl::decay< T >::type > | etl::make_optional (T &value)
| Make an optional.
template<typename T>
ETL_CONSTEXPR20_STL void | etl::swap (etl::optional< T > &lhs, etl::optional< T > &rhs) ETL_NOEXCEPT_FROM(lhs.swap(rhs))
| Template deduction guides.

## Variables

const nullopt_t | etl::nullopt = {}

## Macro Definition Documentation

## ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL

#define ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL

Value:
ETL_CONSTEXPR20_STL \
typename etl::enable_if< !etl::is_pod<typename etl::remove_cv<T>::type>::value, bool>::type
type