std::experi...es::greater(3)
π std::experi...es::greater(3) π
okay bestie, we're in the C++ Standard Libary manual and this page is about std::experi...es::greater(3) β it's giving experimental ranges comparison-function-object energy π no cap.
β¨ NAME β¨
std::experimental::ranges::greater β std::experimental::ranges::greater. yes bestie, the name is the name twice, iconic of manpages π
πΈ Synopsis πΈ
Defined in header <experimental/ranges/functional>
template< class T = void >
requires StrictTotallyOrdered<T> ||
Same<T, void> ||
(ranges TS)
/* < on two const T lvalues invokes a built-in operator
comparing pointers */
struct greater;
template<>
(ranges TS)
struct greater<void>;
Function object for performing comparisons. The primary template invokes operator< on const lvalues of type T with the argument order inverted. The specialization greater<void> deduces the parameter types of the function call operator from the arguments (but not the return type).
All specializations of greater are Semiregular.
π Member types π
- Member type:
is_transparentβ Definition:/* unspecified */(member only of thegreater<void>specialization)
β¨ Member functions β¨
operator()β checks if the first argument is greater than the second (public member function)
π«Ά std::experimental::ranges::greater::operator()
Overload (1) β member only of the primary greater<T> template:
constexpr bool operator()(const T& x, const T& y) const;
Overload (2) β member only of the greater<void> specialization:
template< class T, class U >
requires StrictTotallyOrderedWith<T, U> ||
/* std::declval<T>() <
std::declval<U>() resolves to
a built-in operator comparing
pointers */
constexpr bool operator()(T&& t, U&& u) const;
- Compares
xandy. Equivalent toreturn ranges::less<>{}(y, x);. - Compares
tandu. Equivalent toreturn ranges::less<>{}(std::forward<U>(u), std::forward<T>(t));.
π¦ Notes π¦
Unlike std::greater, ranges::greater requires all six comparison operators <, <=, >, >=, == and != to be valid (via the StrictTotallyOrdered and StrictTotallyOrderedWith constraints) and is entirely defined in terms of ranges::less. However, the implementation is free to use operator> directly, because those concepts require the results of the comparison operators to be consistent.
π Example π
This section is incomplete. Reason: no example.
π See also π
greaterβ function object implementingx > y(class template)
π Category: π
- Todo no example
shoutout to the source/version at http://cppreference.com, dated 2024.06.10, for this std::experi...es::greater(3) page β bye bestie, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms