std::ranges::greater(3)

πŸ’… std::ranges::greater β€” a libstdc++ moment

okay so bestie, welcome to the libstdc++ manual, and today's main character is std::ranges::greater. it's a function object type. that's it. that's the whole vibe. but like, it's an iconic one so let's get into it ✨


πŸŽ€ NAME πŸŽ€

std::ranges::greater β€” the ranges::greater function object type. no cap.


✨ SYNOPSIS ✨

first things first, you gotta pull it in:

#include <functional>

that's the whole entry fee bestie 🫢

🌸 Public Types 🌸

  • using is_transparent β€” yep, it's transparent. it said "let them see through me" and honestly? slay. πŸ’…

πŸ¦‹ Static Public Member Functions πŸ¦‹

  • template<typename _Tp, typename _Up> static constexpr bool operator()(_Tp &&__t, _Up &&__u) noexcept(noexcept(std::declval< _Up >()< std::declval< _Tp >()))

here's the full signature in all its glory, written out exactly how the page has it:

template<typename _Tp, typename _Up> static constexpr bool operator()
    (_Tp &&__t, _Up &&__u) noexcept(noexcept(std::declval< _Up >()<
    std::declval< _Tp >()))

so like, it's a static constexpr bool β€” yes it's constexpr, we love a compile-time queen πŸ‘‘ β€” and it takes two forwarding references, __t and __u. and can we talk about the noexcept?? it's checking std::declval< _Up >() < std::declval< _Tp >() β€” the flipped version, with _Up on the left and _Tp on the right. it's giving "we're checking the less-than so we can do the greater-than". iykyk 😭✨


πŸ’– Detailed Description πŸ’–

ranges::greater function object type. short, sweet, and to the point β€” the manpage said what it said and dipped. periodt. πŸ’€


🌈 Author 🌈

Generated automatically by Doxygen for libstdc++ from the source code. so like, no human wrote this, it's a robot's magnum opus and honestly the robot ate πŸ”₯


and that's the whole page bestie!! this little cutie lives in libstdc++ and it came to us from the Doxygen-generated source code, so when you see the footer down there at the bottom of the page, that's the libstdc++ name reppin' itself, no date attached β€” it just showed up, served, and left. go compare some things, drink water, and stan transparent comparators πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms