folly::operator<=>

Three-way comparison operators

Synopses

Declared in <folly/IPAddress.h>

Three-way comparison operator

constexpr
std::strong_ordering
operator<=>(
    BasicFixedString const& a,
    Range<Char const*> b) noexcept;
» more...

Three-way comparison operator

template<__tuple_like_no_tuple _UTuple>
requires (sizeof...(_Tp) == tuple_size_v<_UTuple>)
constexpr
__tuple_common_comparison_category<tuple, _UTuple>
operator<=>(
    emplace_args const& __x,
    _UTuple const& __y);
» more...

Orders two wrappers by their owned values.

template<
    typename U,
    typename AA>
constexpr
/* implementation-defined */
operator<=>(
    indirect const& lhs,
    indirect<U, AA> const& rhs);
» more...

Orders a wrapper against a value.

template<typename U>
requires (!std::is_same_v<std::remove_cvref_t<U>, indirect>)
constexpr
/* implementation-defined */
operator<=>(
    indirect const& lhs,
    U const& rhs);
» more...

Three-way-compare a wrapper against a value of another type.

template<
    typename Pointer,
    typename Other>
constexpr
decltype(get_underlying(a) <=> b)
operator<=>(
    propagate_const<Pointer> const& a,
    Other const& b);
» more...

Three-way-compare two wrappers by their underlying pointers.

template<typename Pointer>
constexpr
decltype(get_underlying(a) <=> get_underlying(b))
operator<=>(
    propagate_const<Pointer> const& a,
    propagate_const<Pointer> const& b) noexcept(/* see-below */);
» more...

Three-way-compare two strong values; available iff T is comparable.

auto
operator<=>(
    strong const& lhs,
    strong const& rhs) = default;
» more...

Three-way-compare a strong against a value of the underlying type.

template<typename U>
requires std::same_as<std::remove_cvref_t<U>, T>
constexpr
auto
operator<=>(
    strong const& st,
    U&& underlying);
» more...

Orders two BasicFixedString objects.

template<
    class Char,
    std::size_t A,
    std::size_t B>
constexpr
std::strong_ordering
operator<=>(
    BasicFixedString<Char, A> const& a,
    BasicFixedString<Char, B> const& b) noexcept;
» more...

Orders a BasicFixedString against a null-terminated string or a character range.

constexpr
std::strong_ordering
operator<=>(
    Char const* a,
    BasicFixedString const& b) noexcept;
» more...

Three-way comparison operator

constexpr
std::strong_ordering
operator<=>(
    BasicFixedString const& a,
    Char const* b) noexcept;
» more...

Three-way comparison operator

constexpr
std::strong_ordering
operator<=>(
    Range<Char const*> a,
    BasicFixedString const& b) noexcept;
» more...

Three-way compares a string with a std::basic_string.

template<typename A2>
auto
operator<=>(
    basic_fbstring const& lhs,
    std::basic_string<E, T, A2> const& rhs);
» more...

Compares two maps lexicographically by three-way comparison.

template<typename U = Container>
decltype(std::declval<const U&>() <=> std::declval<const U&>())
operator<=>(
    sorted_vector_map const& lhs,
    sorted_vector_map const& rhs);
» more...

Compares two sets lexicographically by three-way comparison.

template<typename U = Container>
decltype(std::declval<const U&>() <=> std::declval<const U&>())
operator<=>(
    sorted_vector_set const& lhs,
    sorted_vector_set const& rhs);
» more...

Three-way comparison for IPAddress.

std::strong_ordering
operator<=>(
    IPAddress const& addr1,
    IPAddress const& addr2) noexcept;
» more...

Three-way comparison for IPAddressV6.

auto
operator<=>(
    IPAddressV6 const& a,
    IPAddressV6 const& b) noexcept;
» more...

Three-way compare two small_vectors lexicographically.

template<typename U = value_type>
decltype(std::declval<const U&>() <=> std::declval<const U&>())
operator<=>(
    small_vector const& lhs,
    small_vector const& rhs);
» more...

Three-way comparison for IPAddressV4.

auto
operator<=>(
    IPAddressV4 const& a,
    IPAddressV4 const& b) noexcept;
» more...

Three-way comparison against nullptr is deleted.

template<
    typename E,
    class T,
    class A,
    class S>
bool
operator<=>(
    basic_fbstring<E, T, A, S> const& lhs,
    std::nullptr_t rhs) = delete;
» more...

Three-way comparison against nullptr is deleted.

template<
    typename E,
    class T,
    class A,
    class S>
bool
operator<=>(
    std::nullptr_t lhs,
    basic_fbstring<E, T, A, S> const& rhs) = delete;
» more...

Three-way compares two strings.

auto
operator<=>(
    basic_fbstring const& lhs,
    basic_fbstring const& rhs);
» more...

Three-way compares a string with a null-terminated array.

auto
operator<=>(
    basic_fbstring const& lhs,
    char const* rhs);
» more...

Return Value

  • The three-way comparison result of the owned values.
  • The three-way comparison result of the owned value and rhs.
  • The result of comparing the underlying pointer with b.
  • The result of comparing the underlying pointers.
  • The result of comparing the wrapped values.
  • The result of comparing the wrapped value against underlying.
  • The three-way ordering of a relative to b.
  • The ordering of lhs relative to rhs.
  • The result of the three-way comparison of the two maps.
  • The result of the three-way comparison of the two sets.
  • The ordering of addr1 relative to addr2.
  • The ordering between the two addresses.
  • The result of the lexicographical three-way comparison.
  • the ordering of a relative to b
  • Never returns; this overload is deleted.

Parameters

NameDescription
lhsThe left-hand wrapper.
rhsThe right-hand wrapper.
aThe wrapper operand.
bThe other operand.
stThe strong value.
underlyingA value of the underlying type T.
addr1The first address to compare.
addr2The second address to compare.