folly::operator<=>

Three-way comparison operators

Synopses

Declared in <folly/IPAddress.h>

Orders a wrapper against a value.

constexpr
/* implementation-defined */
operator<=>(
    indirect const& lhs,
    U const& rhs);
» 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.

constexpr
auto
operator<=>(
    strong const& st,
    U&& underlying);
» 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...

Compares two maps lexicographically by three-way comparison.

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.

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

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

Three-way comparison for IPAddressV6.

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

Orders two wrappers by their owned values.

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

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

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

Three-way compare two small_vectors lexicographically.

decltype(std::declval<const U&>() <=> std::declval<const U&>())
operator<=>(
    small_vector const& lhs,
    small_vector const& rhs);
» 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 comparison operator

constexpr
std::strong_ordering
operator<=>(
    BasicFixedString const& a,
    Range<Char 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 value and rhs.
  • The result of comparing the wrapped values.
  • The result of comparing the wrapped value against underlying.
  • The result of comparing the underlying pointer with b.
  • The result of comparing the underlying pointers.
  • 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 of a relative to b
  • The ordering between the two addresses.
  • The three-way comparison result of the owned values.
  • The ordering of lhs relative to rhs.
  • The result of the lexicographical three-way comparison.
  • The three-way ordering of a relative to b.
  • Never returns; this overload is deleted.

Parameters

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