|
constexpr | optional () noexcept=default |
| Constructs an object that does not contain a value.
|
|
constexpr | optional () noexcept=default |
|
constexpr | optional (in_place_t, Args &&... args) |
| Constructs an optional object that contains a value, initialized as if direct-initializing.
|
|
constexpr | optional (nullopt_t) noexcept |
| Constructs an object that does not contain a value.
|
|
constexpr | optional (nullopt_t) noexcept |
|
constexpr | optional (optional &&) noexcept(is_nothrow_move_constructible_v< value_type >)=default |
| Move constructor.
|
|
constexpr | optional (optional &&other) noexcept=default |
|
constexpr | optional (optional const &)=default |
| Copy constructor.
|
|
constexpr | optional (optional const &other)=default |
|
constexpr | ~optional ()=default |
|
constexpr auto | and_then (F &&f) & |
|
constexpr auto | and_then (F &&f) && |
|
constexpr auto | and_then (F &&f) const & |
|
constexpr auto | and_then (F &&f) const && |
|
constexpr auto | emplace (Args &&... args) -> value_type & |
| Constructs the contained value in-place. If *this already contains a value before the call, the contained value is destroyed by calling its destructor.
|
|
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>) |
constexpr auto | emplace (U &&u) noexcept -> optional & |
|
| explicit (not is_convertible_v< U &&, T >) const expr optional(optional< U > &&other) |
| Converting move constructor.
|
|
| explicit (not is_convertible_v< U &&, T >) const expr optional(U &&value) |
| Constructs an optional object that contains a value, initialized as if direct-initializing.
|
|
| explicit (not is_convertible_v< U const &, T >) const expr optional(optional< U > const &other) |
| Converting copy constructor.
|
|
template<typename U>
requires (not is_same_v<remove_cvref_t<U>, optional>) |
constexpr | explicit (not is_convertible_v< U, T >) optional(optional< U > const &rhs) |
|
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>) |
constexpr | explicit (not is_convertible_v< U, T >) optional(U &&v) |
|
constexpr auto | has_value () const noexcept -> bool |
| Checks whether *this contains a value.
|
|
constexpr auto | has_value () const noexcept -> bool |
|
constexpr | operator bool () const noexcept |
| Checks whether *this contains a value.
|
|
constexpr | operator bool () const noexcept |
|
constexpr auto | operator* () &&-> T && |
| Returns a reference to the contained value.
|
|
constexpr auto | operator* () &-> T & |
| Returns a reference to the contained value.
|
|
constexpr auto | operator* () const &&-> T const && |
| Returns a reference to the contained value.
|
|
constexpr auto | operator* () const &-> T const & |
| Returns a reference to the contained value.
|
|
constexpr auto | operator* () const noexcept -> T & |
|
constexpr auto | operator-> () -> value_type * |
| Returns a pointer to the contained value. The pointer is null if the optional is empty.
|
|
constexpr auto | operator-> () const -> value_type const * |
| Returns a pointer to the contained value. The pointer is null if the optional is empty.
|
|
constexpr auto | operator-> () const noexcept -> T * |
|
constexpr auto | operator= (etl::nullopt_t) noexcept -> optional & |
| If *this contains a value before the call, the contained value is destroyed by calling its destructor as if by value().T::~T(). *this does not contain a value after this call.
|
|
constexpr auto | operator= (nullopt_t) noexcept -> optional & |
|
constexpr auto | operator= (optional &&) noexcept -> optional &=default |
|
constexpr auto | operator= (optional &&other) noexcept -> optional &=default |
| Assigns the state of other.
|
|
constexpr auto | operator= (optional const &) noexcept -> optional &=default |
|
constexpr auto | operator= (optional const &other) -> optional &=default |
| Assigns the state of other.
|
|
constexpr auto | operator= (optional< U > &&other) -> optional & |
| Assigns the state of other.
|
|
constexpr auto | operator= (optional< U > const &other) -> optional & |
| Assigns the state of other.
|
|
template<typename U> |
constexpr auto | operator= (optional< U > const &rhs) -> optional & |
|
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional> and not conjunction_v<is_scalar<T>, is_same<T, decay_t<U>>>) |
constexpr auto | operator= (U &&v) -> optional & |
|
constexpr auto | operator= (U &&value) -> optional & |
| Perfect-forwarded assignment.
|
|
constexpr auto | or_else (F &&f) &&-> optional |
|
constexpr auto | or_else (F &&f) const &-> optional |
|
constexpr void | reset () noexcept |
|
constexpr auto | reset () noexcept -> void |
| If *this contains a value, destroy that value as if by value().~value_type(). Otherwise, there are no effects. *this does not contain a value after this call.
|
|
constexpr auto | swap (optional &other) noexcept(is_nothrow_move_constructible_v< value_type > and is_nothrow_swappable_v< value_type >) -> void |
| Swaps the contents with those of other.
|
|
constexpr void | swap (optional &rhs) noexcept |
|
constexpr auto | value_or (U &&defaultValue) &&-> value_type |
| Returns the contained value if *this has a value, otherwise returns default_value.
|
|
constexpr auto | value_or (U &&defaultValue) const &-> value_type |
| Returns the contained value if *this has a value, otherwise returns default_value.
|
|
|
(Note that these are not member symbols.)
|
| optional (T) -> optional< T > |
|
| optional (T) -> optional< T > |
|
constexpr auto | make_optional (Args &&... args) -> etl::optional< T > |
| Creates an optional object constructed in-place from args...
|
|
constexpr auto | make_optional (Args &&... args) -> etl::optional< T > |
| Creates an optional object constructed in-place from args...
|
|
constexpr auto | make_optional (T &&value) -> etl::optional< etl::decay_t< T > > |
| Creates an optional object from value.
|
|
constexpr auto | make_optional (T &&value) -> etl::optional< etl::decay_t< T > > |
| Creates an optional object from value.
|
|
constexpr auto | operator< (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator< (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator< (optional< T > const &, etl::nullopt_t) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator< (optional< T > const &, etl::nullopt_t) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator< (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator< (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
constexpr auto | operator<= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator<= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
constexpr auto | operator== (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator== (etl::nullopt_t, optional< T > const &opt) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator== (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator== (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator== (optional< T > const &opt, etl::nullopt_t) noexcept -> bool |
| Compares opt with a nullopt.
|
|
constexpr auto | operator== (optional< T > const &opt, etl::nullopt_t) noexcept -> bool |
| Compares opt with a nullopt.
|
|
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.
|
|
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.
|
|
constexpr auto | operator> (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator> (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
constexpr auto | operator>= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
constexpr auto | operator>= (optional< T > const &lhs, optional< U > const &rhs) -> bool |
| Compares two optional objects, lhs and rhs.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|