Three‐way comparison operators

Synopses

Declared in <beman/optional/optional.hpp>

Three‐way comparison operator

template<
    typename T,
    std::three_way_comparable_with<T> U>
constexpr
std::compare_three_way_result_t<T, U>
operator<=>(
    optional<T> const& x,
    optional<U> const& y);

Three‐way comparison operator

template<class T>
constexpr
std::strong_ordering
operator<=>(
    optional<T> const& x,
    nullopt_t rhs) noexcept;

Three‐way comparison operator

template<
    typename T,
    typename U>
requires (!is_derived_from_optional<U>) && std::three_way_comparable_with<T, U>
constexpr
std::compare_three_way_result_t<T, U>
operator<=>(
    optional<T> const& x,
    U const& v);

Created with MrDocs