tetl 0.1.0
Embedded Template Library
|
etl::optional class template More...
Classes | |
struct | bad_optional_access |
Defines a type of object to be thrown by etl::optional::value when accessing an optional object that does not contain a value. More... | |
struct | hash< etl::optional< T > > |
The template specialization of etl::hash for the etl::optional class allows users to obtain hashes of the values contained in optional objects. More... | |
struct | nullopt_t |
etl::nullopt_t is an empty class type used to indicate optional type with uninitialized state. In particular, etl::optional has a constructor with nullopt_t as a single argument, which creates an optional that does not contain a value. More... | |
struct | optional< T > |
The class template optional manages an optional contained value, i.e. a value that may or may not be present. More... | |
Functions | |
template<typename T> | |
optional (T) -> optional< T > | |
template<typename T, typename... Args> | |
constexpr auto | make_optional (Args &&... args) -> etl::optional< T > |
Creates an optional object constructed in-place from args... | |
template<typename T> | |
constexpr auto | make_optional (T &&value) -> etl::optional< etl::decay_t< T > > |
Creates an optional object from value. | |
template<typename T> | |
constexpr auto | operator< (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
Compares opt with a nullopt. | |
template<typename T> | |
constexpr auto | operator< (optional< T > const &, etl::nullopt_t) noexcept -> bool |
Compares opt with a nullopt. | |
template<typename T, typename U> | |
constexpr auto | operator< (optional< T > const &lhs, optional< U > const &rhs) -> bool |
Compares two optional objects, lhs and rhs. | |
template<typename T, typename U> | |
constexpr auto | operator< (optional< T > const &opt, U const &value) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator< (T const &value, optional< U > const &opt) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator<= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
Compares two optional objects, lhs and rhs. | |
template<typename T, typename U> | |
constexpr auto | operator<= (optional< T > const &opt, U const &value) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator<= (T const &value, optional< U > const &opt) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T> | |
constexpr auto | operator== (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
Compares opt with a nullopt. | |
template<typename T, typename U> | |
constexpr auto | operator== (optional< T > const &lhs, optional< U > const &rhs) -> bool |
Compares two optional objects, lhs and rhs. | |
template<typename T> | |
constexpr auto | operator== (optional< T > const &opt, etl::nullopt_t) noexcept -> bool |
Compares opt with a nullopt. | |
template<typename T, typename U> | |
constexpr auto | operator== (optional< T > const &opt, U const &value) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator> (optional< T > const &lhs, optional< U > const &rhs) -> bool |
Compares two optional objects, lhs and rhs. | |
template<typename T, typename U> | |
constexpr auto | operator> (optional< T > const &opt, U const &value) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator> (T const &value, optional< U > const &opt) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator>= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
Compares two optional objects, lhs and rhs. | |
template<typename T, typename U> | |
constexpr auto | operator>= (optional< T > const &opt, U const &value) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
template<typename T, typename U> | |
constexpr auto | operator>= (T const &value, optional< U > const &opt) -> bool |
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed. | |
Variables | |
constexpr auto | nullopt = etl::nullopt_t{0} |
etl::nullopt is a constant of type etl::nullopt_t that is used to indicate optional type with uninitialized state. | |
etl::optional class template
|
Creates an optional object constructed in-place from args...
|
Creates an optional object from value.
|
Compares opt with a nullopt.
Equivalent to when comparing to an optional that does not contain a value.
|
Compares opt with a nullopt.
Equivalent to when comparing to an optional that does not contain a value.
|
Compares two optional objects, lhs and rhs.
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares two optional objects, lhs and rhs.
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares opt with a nullopt.
Equivalent to when comparing to an optional that does not contain a value.
|
Compares two optional objects, lhs and rhs.
|
Compares opt with a nullopt.
Equivalent to when comparing to an optional that does not contain a value.
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares two optional objects, lhs and rhs.
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares two optional objects, lhs and rhs.
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
Compares opt with a value. The values are compared (using the corresponding operator of T) only if opt contains a value. Otherwise, opt is considered less than value. If the corresponding two-way comparison expression between *opt and value is not well-formed, or if its result is not convertible to bool, the program is ill-formed.
https://en.cppreference.com/w/cpp/utility/optional/operator_cmp
|
etl::nullopt is a constant of type etl::nullopt_t that is used to indicate optional type with uninitialized state.