Three‐way comparison operators

Synopses

Declared in <bslstl_deque.h>

Return the lexicographic three‐way comparison of lhs and rhs.

Perform a lexicographic three‐way comparison of lhs and rhs.

Return the three‐way comparison result of lhs and rhs.

template<
    class VALUE,
    three_way_comparable CONTAINER>
compare_three_way_result_t<CONTAINER>
operator<=>(
    queue<VALUE, CONTAINER> const& lhs,
    queue<VALUE, CONTAINER> const& rhs);

Return the three‐way comparison of the specified queues; see the non‐member operator<=> in the bsl namespace.

compare_three_way_result_t<CONTAINER2>
operator<=>(
    queue<VALUE2, CONTAINER2> const& lhs,
    queue<VALUE2, CONTAINER2> const& rhs);

Return the three‐way comparison result of lhs and rhs.

template<class... t_ALTS>
requires (std::three_way_comparable<t_ALTS> && ...)
constexpr
std::common_comparison_category_t<std::compare_three_way_result_t<t_ALTS>...>
operator<=>(
    variant<t_ALTS...> const& lhs,
    variant<t_ALTS...> const& rhs);

Return the three‐way comparison result of the specified lhs and rhs stacks by comparing their underlying containers.

template<
    class VALUE,
    three_way_comparable CONTAINER>
compare_three_way_result_t<CONTAINER>
operator<=>(
    stack<VALUE, CONTAINER> const& lhs,
    stack<VALUE, CONTAINER> const& rhs);

Return the three‐way comparison of the specified stacks; see the non‐member operator<=> in the bsl namespace.

compare_three_way_result_t<CONT>
operator<=>(
    stack<VAL, CONT> const& lhs,
    stack<VAL, CONT> const& rhs);

Perform a lexicographic three‐way comparison of lhs and rhs.

Perform a three‐way comparison of the operands.

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

Perform a three‐way comparison of the operands.

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

Perform a three‐way comparison of the operands.

template<
    class t_LHS,
    class t_RHS>
requires (!BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS>) &&
         three_way_comparable_with<t_LHS, t_RHS>
constexpr
compare_three_way_result_t<t_LHS, t_RHS>
operator<=>(
    bsl::optional<t_LHS> const& lhs,
    t_RHS const& rhs);

Perform a three‐way comparison of the operands.

template<
    class t_LHS,
    three_way_comparable_with<t_LHS> t_RHS>
constexpr
compare_three_way_result_t<t_LHS, t_RHS>
operator<=>(
    bsl::optional<t_LHS> const& lhs,
    bsl::optional<t_RHS> const& rhs);

Compare the specified lhs and rhs pairs lexicographically.

template<
    class T1,
    class T2>
constexpr
std::common_comparison_category_t<BloombergLP::bslalg::SynthThreeWayUtil::Result<T1>, BloombergLP::bslalg::SynthThreeWayUtil::Result<T2>>
operator<=>(
    pair<T1, T2> const& lhs,
    pair<T1, T2> const& rhs);

Perform a lexicographic three‐way comparison of lhs and rhs.

template<
    class KEY,
    class COMPARATOR,
    class ALLOCATOR>
BloombergLP::bslalg::SynthThreeWayUtil::Result<KEY>
operator<=>(
    set<KEY, COMPARATOR, ALLOCATOR> const& lhs,
    set<KEY, COMPARATOR, ALLOCATOR> const& rhs);

Perform a lexicographic three‐way comparison of lhs and rhs.

Perform a lexicographic three‐way comparison of lhs and rhs.

Perform a three‐way comparison of the specified ptr and null pointer by using the comparison operators of TYPE *; return the result of that comparison.

template<class TYPE>
std::strong_ordering
operator<=>(
    shared_ptr<TYPE> const& ptr,
    nullptr_t nullPointerLiteral) noexcept;

Compare lhs and rhs three‐way by their stored pointers.

template<
    class LHS_TYPE,
    class RHS_TYPE>
std::strong_ordering
operator<=>(
    shared_ptr<LHS_TYPE> const& lhs,
    shared_ptr<RHS_TYPE> const& rhs) noexcept;

Perform a lexicographic three‐way comparison of two strings.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC1,
    class ALLOC2>
bsl::String_ComparisonCategoryType<CHAR_TRAITS>
operator<=>(
    bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs,
    std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs) noexcept;

Perform a lexicographic three‐way comparison of two strings.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC>
bsl::String_ComparisonCategoryType<CHAR_TRAITS>
operator<=>(
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& lhs,
    CHAR_TYPE const* rhs);

Perform a lexicographic three‐way comparison of two strings.

template<
    class CHAR_TYPE,
    class CHAR_TRAITS,
    class ALLOC>
bsl::String_ComparisonCategoryType<CHAR_TRAITS>
operator<=>(
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& lhs,
    basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC> const& rhs) noexcept;

Perform a three‐way comparison of the specified lhs and rhs vectors and return the result of that comparison.

Perform a three‐way comparison of the operands.

Return Value

  • three‐way comparison result of the two multisets

  • result of the three‐way comparison

  • three‐way comparison result of the queues

  • the three‐way comparison result of lhs and rhs

  • result of the lexicographic three‐way comparison

  • three‐way comparison result of ptr and a null pointer

  • three‐way comparison result of the stored pointers

  • ordering result of the lexicographic three‐way comparison

Parameters

Name

Description

lhs

left‐hand multiset to compare

rhs

right‐hand multiset to compare

value

value compared with or used to initialize the optional

nullopt

disengaged‐optional tag; value is unused

ptr

pointer to the object to manage or refer to

nullPointerLiteral

null‐pointer literal (unused; selects this overload)

Created with MrDocs