tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
optional< T & > Struct Template Reference

#include <optional.hpp>

Public Types

using value_type
 
using value_type = T&
 

Public Member Functions

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.
 

Related Symbols

(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.
 

Member Typedef Documentation

◆ value_type [1/2]

using value_type

◆ value_type [2/2]

template<typename T>
using value_type = T&

Constructor & Destructor Documentation

◆ optional() [1/9]

template<typename T>
optional ( )
constexprdefaultnoexcept

◆ optional() [2/9]

template<typename T>
optional ( nullopt_t )
inlineconstexprnoexcept

◆ optional() [3/9]

template<typename T>
optional ( optional< T & > const & other)
constexprdefault

◆ optional() [4/9]

template<typename T>
optional ( optional< T & > && other)
constexprdefaultnoexcept

◆ ~optional()

template<typename T>
~optional ( )
constexprdefault

◆ optional() [5/9]

optional ( )
constexprdefaultnoexcept

Constructs an object that does not contain a value.

◆ optional() [6/9]

optional ( nullopt_t )
inlineconstexprnoexcept

Constructs an object that does not contain a value.

◆ optional() [7/9]

optional ( optional< T & > const & )
constexprdefault

Copy constructor.

◆ optional() [8/9]

optional ( optional< T & > && )
constexprdefaultnoexcept

Move constructor.

◆ optional() [9/9]

optional ( in_place_t ,
Args &&... args )
inlineexplicitconstexpr

Constructs an optional object that contains a value, initialized as if direct-initializing.

https://en.cppreference.com/w/cpp/utility/optional/optional

Member Function Documentation

◆ and_then() [1/4]

auto and_then ( F && f) &
inlineconstexpr

◆ and_then() [2/4]

auto and_then ( F && f) &&
inlineconstexpr

◆ and_then() [3/4]

auto and_then ( F && f) const &
inlineconstexpr

◆ and_then() [4/4]

auto and_then ( F && f) const &&
inlineconstexpr

◆ emplace() [1/2]

auto emplace ( Args &&... args) -> value_type&
inlineconstexpr

Constructs the contained value in-place. If *this already contains a value before the call, the contained value is destroyed by calling its destructor.

◆ emplace() [2/2]

template<typename T>
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
auto emplace ( U && u) -> optional&
inlineconstexprnoexcept

◆ explicit() [1/5]

explicit ( not is_convertible_v< U &&, T > ) const &&
inline

Converting move constructor.

If other doesn't contain a value, constructs an optional object that does not contain a value. Otherwise, constructs an optional object that contains a value, initialized as if direct-initializing (but not direct-list-initializing) an object of type T with the expression etl::move(*other).

https://en.cppreference.com/w/cpp/utility/optional/optional

◆ explicit() [2/5]

explicit ( not is_convertible_v< U &&, T > ) const &&
inline

Constructs an optional object that contains a value, initialized as if direct-initializing.

https://en.cppreference.com/w/cpp/utility/optional/optional

◆ explicit() [3/5]

explicit ( not is_convertible_v< U const &, T > ) const &
inline

Converting copy constructor.

If other doesn't contain a value, constructs an optional object that does not contain a value. Otherwise, constructs an optional object that contains a value, initialized as if direct-initializing (but not direct-list-initializing) an object of type T with the expression *other.

https://en.cppreference.com/w/cpp/utility/optional/optional

◆ explicit() [4/5]

template<typename T>
template<typename U>
requires (not is_same_v<remove_cvref_t<U>, optional>)
explicit ( not is_convertible_v< U, T > ) const &
inlineconstexpr

◆ explicit() [5/5]

template<typename T>
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
explicit ( not is_convertible_v< U, T > ) &&
inlineconstexpr

◆ has_value() [1/2]

auto has_value ( ) const -> bool
inlinenodiscardconstexprnoexcept

Checks whether *this contains a value.

◆ has_value() [2/2]

template<typename T>
auto has_value ( ) const -> bool
inlinenodiscardconstexprnoexcept

◆ operator bool() [1/2]

operator bool ( ) const
inlineexplicitnodiscardconstexprnoexcept

Checks whether *this contains a value.

◆ operator bool() [2/2]

template<typename T>
operator bool ( ) const
inlineexplicitnodiscardconstexprnoexcept

◆ operator*() [1/5]

auto operator* ( ) && -> T&&
inlinenodiscardconstexpr

Returns a reference to the contained value.

This operator only checks whether the optional contains a value in debug builds! You can do so manually by using has_value() or simply operator bool(). Alternatively, if checked access is needed, value() or value_or() may be used.

https://en.cppreference.com/w/cpp/utility/optional/operator*

◆ operator*() [2/5]

auto operator* ( ) & -> T&
inlinenodiscardconstexpr

Returns a reference to the contained value.

This operator only checks whether the optional contains a value in debug builds! You can do so manually by using has_value() or simply operator bool(). Alternatively, if checked access is needed, value() or value_or() may be used.

https://en.cppreference.com/w/cpp/utility/optional/operator*

◆ operator*() [3/5]

auto operator* ( ) const && -> T const&&
inlinenodiscardconstexpr

Returns a reference to the contained value.

This operator only checks whether the optional contains a value in debug builds! You can do so manually by using has_value() or simply operator bool(). Alternatively, if checked access is needed, value() or value_or() may be used.

https://en.cppreference.com/w/cpp/utility/optional/operator*

◆ operator*() [4/5]

auto operator* ( ) const & -> T const&
inlinenodiscardconstexpr

Returns a reference to the contained value.

This operator only checks whether the optional contains a value in debug builds! You can do so manually by using has_value() or simply operator bool(). Alternatively, if checked access is needed, value() or value_or() may be used.

https://en.cppreference.com/w/cpp/utility/optional/operator*

◆ operator*() [5/5]

template<typename T>
auto operator* ( ) const -> T&
inlinenodiscardconstexprnoexcept

◆ operator->() [1/3]

auto operator-> ( ) -> value_type*
inlinenodiscardconstexpr

Returns a pointer to the contained value. The pointer is null if the optional is empty.

◆ operator->() [2/3]

auto operator-> ( ) const -> value_type const*
inlinenodiscardconstexpr

Returns a pointer to the contained value. The pointer is null if the optional is empty.

◆ operator->() [3/3]

template<typename T>
auto operator-> ( ) const -> T*
inlinenodiscardconstexprnoexcept

◆ operator=() [1/11]

auto operator= ( etl::nullopt_t ) -> optional&
inlineconstexprnoexcept

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.

◆ operator=() [2/11]

template<typename T>
auto operator= ( nullopt_t ) -> optional&
inlineconstexprnoexcept

◆ operator=() [3/11]

template<typename T>
auto operator= ( optional< T & > && ) -> optional &=default
constexprdefaultnoexcept

◆ operator=() [4/11]

auto operator= ( optional< T & > && other) -> optional&
constexprdefaultnoexcept

Assigns the state of other.

◆ operator=() [5/11]

template<typename T>
auto operator= ( optional< T & > const & ) -> optional &=default
constexprdefaultnoexcept

◆ operator=() [6/11]

auto operator= ( optional< T & > const & other) -> optional&
constexprdefault

Assigns the state of other.

◆ operator=() [7/11]

auto operator= ( optional< U > && other) -> optional&
inlineconstexpr

Assigns the state of other.

◆ operator=() [8/11]

auto operator= ( optional< U > const & other) -> optional&
inlineconstexpr

Assigns the state of other.

◆ operator=() [9/11]

template<typename T>
template<typename U>
auto operator= ( optional< U > const & rhs) -> optional&
inlineconstexpr

◆ operator=() [10/11]

template<typename T>
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>>>)
auto operator= ( U && v) -> optional&
inlineconstexpr

◆ operator=() [11/11]

auto operator= ( U && value) -> optional&
inlineconstexpr

Perfect-forwarded assignment.

Depending on whether *this contains a value before the call, the contained value is either direct-initialized from etl::forward<U>(value) or assigned from etl::forward<U>(value).

https://en.cppreference.com/w/cpp/utility/optional/operator%3D

◆ or_else() [1/2]

auto or_else ( F && f) &&-> optional
inlineconstexpr

◆ or_else() [2/2]

auto or_else ( F && f) const &-> optional
inlineconstexpr

◆ reset() [1/2]

template<typename T>
void reset ( )
inlineconstexprnoexcept

◆ reset() [2/2]

auto reset ( ) -> void
inlineconstexprnoexcept

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.

◆ swap() [1/2]

auto swap ( optional< T & > & other) -> void
inlineconstexprnoexcept

Swaps the contents with those of other.

◆ swap() [2/2]

template<typename T>
void swap ( optional< T & > & rhs)
inlineconstexprnoexcept

◆ value_or() [1/2]

auto value_or ( U && defaultValue) &&-> value_type
inlinenodiscardconstexpr

Returns the contained value if *this has a value, otherwise returns default_value.

◆ value_or() [2/2]

auto value_or ( U && defaultValue) const &-> value_type
inlinenodiscardconstexpr

Returns the contained value if *this has a value, otherwise returns default_value.

Friends And Related Symbol Documentation

◆ optional() [1/2]

optional ( T ) -> optional<T>
related

◆ optional() [2/2]

optional ( T ) -> optional<T>
related

◆ make_optional() [1/4]

auto make_optional ( Args &&... args) -> etl::optional<T>
related

Creates an optional object constructed in-place from args...

◆ make_optional() [2/4]

auto make_optional ( Args &&... args) -> etl::optional<T>
related

Creates an optional object constructed in-place from args...

◆ make_optional() [3/4]

auto make_optional ( T && value) -> etl::optional<etl::decay_t<T>>
related

Creates an optional object from value.

◆ make_optional() [4/4]

auto make_optional ( T && value) -> etl::optional<etl::decay_t<T>>
related

Creates an optional object from value.

◆ operator<() [1/10]

auto operator< ( etl::nullopt_t ,
optional< T > const & opt )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator<() [2/10]

auto operator< ( etl::nullopt_t ,
optional< T > const & opt )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator<() [3/10]

auto operator< ( optional< T > const & ,
etl::nullopt_t  )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator<() [4/10]

auto operator< ( optional< T > const & ,
etl::nullopt_t  )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator<() [5/10]

auto operator< ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator<() [6/10]

auto operator< ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator<() [7/10]

auto operator< ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator<() [8/10]

auto operator< ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator<() [9/10]

auto operator< ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator<() [10/10]

auto operator< ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator<=() [1/6]

auto operator<= ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator<=() [2/6]

auto operator<= ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator<=() [3/6]

auto operator<= ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator<=() [4/6]

auto operator<= ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator<=() [5/6]

auto operator<= ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator<=() [6/6]

auto operator<= ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator==() [1/8]

auto operator== ( etl::nullopt_t ,
optional< T > const & opt )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator==() [2/8]

auto operator== ( etl::nullopt_t ,
optional< T > const & opt )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator==() [3/8]

auto operator== ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator==() [4/8]

auto operator== ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator==() [5/8]

auto operator== ( optional< T > const & opt,
etl::nullopt_t  )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator==() [6/8]

auto operator== ( optional< T > const & opt,
etl::nullopt_t  )-> bool
related

Compares opt with a nullopt.

Equivalent to when comparing to an optional that does not contain a value.

◆ operator==() [7/8]

auto operator== ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator==() [8/8]

auto operator== ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator>() [1/6]

auto operator> ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator>() [2/6]

auto operator> ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator>() [3/6]

auto operator> ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator>() [4/6]

auto operator> ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator>() [5/6]

auto operator> ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator>() [6/6]

auto operator> ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator>=() [1/6]

auto operator>= ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator>=() [2/6]

auto operator>= ( optional< T > const & lhs,
optional< U > const & rhs )-> bool
related

Compares two optional objects, lhs and rhs.

◆ operator>=() [3/6]

auto operator>= ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator>=() [4/6]

auto operator>= ( optional< T > const & opt,
U const & value )-> bool
related

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

◆ operator>=() [5/6]

auto operator>= ( T const & value,
optional< U > const & opt )-> bool
related

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

◆ operator>=() [6/6]

auto operator>= ( T const & value,
optional< U > const & opt )-> bool
related

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


The documentation for this struct was generated from the following file: