19 General utilities library [utilities]

19.14 Function objects [function.objects]

19.14.8 Concept-constrained comparisons [range.cmp]

In this subclause, BUILTIN_­PTR_­CMP(T, op, U) for types T and U and where op is an equality ([expr.eq]) or relational operator ([expr.rel]) is a boolean constant expression.
BUILTIN_­PTR_­CMP(T, op, U) is true if and only if op in the expression declval<T>() op declval<U>() resolves to a built-in operator comparing pointers.
There is an implementation-defined strict total ordering over all pointer values of a given type.
This total ordering is consistent with the partial order imposed by the builtin operators <, >, <=, and >=.
template<class T = void> requires EqualityComparable<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, ==, const T&) struct ranges::equal_to { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return ranges::equal_­to<>{}(x, y);
template<class T = void> requires EqualityComparable<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, ==, const T&) struct ranges::not_equal_to { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return !ranges::equal_­to<>{}(x, y);
template<class T = void> requires StrictTotallyOrdered<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, <, const T&) struct ranges::greater { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return ranges::less<>{}(y, x);
template<class T = void> requires StrictTotallyOrdered<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, <, const T&) struct ranges::less { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return ranges::less<>{}(x, y);
template<class T = void> requires StrictTotallyOrdered<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, <, const T&) struct ranges::greater_equal { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return !ranges::less<>{}(x, y);
template<class T = void> requires StrictTotallyOrdered<T> || Same<T, void> || BUILTIN_PTR_CMP(const T&, <, const T&) struct ranges::less_equal { constexpr bool operator()(const T& x, const T& y) const; };
operator() has effects equivalent to: return !ranges::less<>{}(y, x);
template<> struct ranges::equal_to<void> { template<class T, class U> requires EqualityComparableWith<T, U> || BUILTIN_PTR_CMP(T, ==, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
Expects: If the expression std::forward<T>(t) == std::forward<U>(u) results in a call to a built-in operator == comparing pointers of type P, the conversion sequences from both T and U to P shall be equality-preserving ([concepts.equality]).
Effects:
  • If the expression std::forward<T>(t) == std::forward<U>(u) results in a call to a built-in operator == comparing pointers of type P: returns false if either (the converted value of) t precedes u or u precedes t in the implementation-defined strict total order over pointers of type P and otherwise true.
  • Otherwise, equivalent to: return std::forward<T>(t) == std::forward<U>(u);
template<> struct ranges::not_equal_to<void> { template<class T, class U> requires EqualityComparableWith<T, U> || BUILTIN_PTR_CMP(T, ==, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
operator() has effects equivalent to:
return !ranges::equal_to<>{}(std::forward<T>(t), std::forward<U>(u));
template<> struct ranges::greater<void> { template<class T, class U> requires StrictTotallyOrderedWith<T, U> || BUILTIN_PTR_CMP(U, <, T) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
operator() has effects equivalent to:
return ranges::less<>{}(std::forward<U>(u), std::forward<T>(t));
template<> struct ranges::less<void> { template<class T, class U> requires StrictTotallyOrderedWith<T, U> || BUILTIN_PTR_CMP(T, <, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
Expects: If the expression std::forward<T>(t) < std::forward<U>(u) results in a call to a built-in operator < comparing pointers of type P, the conversion sequences from both T and U to P shall be equality-preserving ([concepts.equality]).
For any expressions ET and EU such that decltype((ET)) is T and decltype((EU)) is U, exactly one of ranges::less<>{}(ET, EU), ranges::less<>{}(EU, ET), or ranges::equal_­to<>{}(ET, EU) shall be true.
Effects:
  • If the expression std::forward<T>(t) < std::forward<U>(u) results in a call to a built-in operator < comparing pointers of type P: returns true if (the converted value of) t precedes u in the implementation-defined strict total order over pointers of type P and otherwise false.
  • Otherwise, equivalent to: return std::forward<T>(t) < std::forward<U>(u);
template<> struct ranges::greater_equal<void> { template<class T, class U> requires StrictTotallyOrderedWith<T, U> || BUILTIN_PTR_CMP(T, <, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
operator() has effects equivalent to:
return !ranges::less<>{}(std::forward<T>(t), std::forward<U>(u));
template<> struct ranges::less_equal<void> { template<class T, class U> requires StrictTotallyOrderedWith<T, U> || BUILTIN_PTR_CMP(U, <, T) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = unspecified; };
operator() has effects equivalent to:
return !ranges::less<>{}(std::forward<U>(u), std::forward<T>(t));