Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::greater

      From cppreference.com
      <cpp‎ |utility‎ |functional
       
       
      Utilities library
       
      Function objects
      Function invocation
      (C++17)(C++23)
      Identity function object
      (C++20)
      Old binders and adaptors
      (until C++17*)
      (until C++17*)
      (until C++17*)
      (until C++17*)  
      (until C++17*)
      (until C++17*)(until C++17*)(until C++17*)(until C++17*)
      (until C++20*)
      (until C++20*)
      (until C++17*)(until C++17*)
      (until C++17*)(until C++17*)

      (until C++17*)
      (until C++17*)(until C++17*)(until C++17*)(until C++17*)
      (until C++20*)
      (until C++20*)
       
      Defined in header<functional>
      struct greater;
      (since C++20)

      Function object for performing comparisons. Deduces the parameter types of the function call operator from the arguments (but not the return type).

      Contents

      [edit]Nested types

      Nested type Definition
      is_transparentunspecified

      [edit]Member functions

      operator()
      checks if the first argument isgreater than the second
      (public member function)

      std::ranges::greater::operator()

      template<class T,class U>
      constexprbool operator()( T&& t, U&& u)const;

      Equivalent toreturnranges::less{}(std::forward<U>(u),std::forward<T>(t));.

      This overload participates in overload resolution only ifstd::totally_ordered_with<T, U> is satisfied.

      [edit]Notes

      Unlikestd::greater,std::ranges::greater requires all six comparison operators<,<=,>,>=,== and!= to be valid (via thetotally_ordered_with constraint) and is entirely defined in terms ofstd::ranges::less.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 3530C++20syntactic checks were relaxed while comparing pointersonly semantic requirements are relaxed

      [edit]See also

      function object implementingx> y
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/functional/ranges/greater&oldid=168285"

      [8]ページ先頭

      ©2009-2025 Movatter.jp