Three‐way comparison operators

Synopses

Declared in <bdlb_nullablevalue.h>

Perform a three‐way comparison of the specified lhs and the specified rhs objects by using the comparison operators of t_LHS and t_RHS; return the result of that comparison.

template<
    class LHS_TYPE,
    bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
constexpr
std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
operator<=>(
    NullableValue<LHS_TYPE> const& lhs,
    NullableValue<RHS_TYPE> const& rhs);

Perform a three‐way comparison of the specified nullable objects.

template<
    class LHS_TYPE,
    bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
constexpr
std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
operator<=>(
    NullableValue<LHS_TYPE> const& lhs,
    bsl::optional<RHS_TYPE> const& rhs);

Perform a three‐way comparison of the specified nullable objects.

template<
    class LHS_TYPE,
    bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
constexpr
std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
operator<=>(
    NullableValue<LHS_TYPE> const& lhs,
    std::optional<RHS_TYPE> const& rhs);

Perform a three‐way comparison of the specified nullable object and value.

template<
    class LHS_TYPE,
    class RHS_TYPE>
requires (!bdlb::NullableValue_DerivedFromOptional<RHS_TYPE>) &&
              bsl::three_way_comparable_with<LHS_TYPE, RHS_TYPE>
constexpr
std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
operator<=>(
    NullableValue<LHS_TYPE> const& lhs,
    RHS_TYPE const& rhs);

Perform a three‐way comparison of the specified value and one of type bsl::nullopt_t; return the result of that comparison.

template<class TYPE>
constexpr
std::strong_ordering
operator<=>(
    NullableValue<TYPE> const& value,
    bsl::nullopt_t const&) noexcept;

Created with MrDocs