Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::equal_to

      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 equal_to;
      (since C++20)

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

      Contents

      [edit]Nested types

      Nested type Definition
      is_transparentunspecified

      [edit]Member functions

      operator()
      checks if the arguments areequal
      (public member function)

      std::ranges::equal_to::operator()

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

      Given the expressionstd::forward<T>(t)==std::forward<U>(u) asexpr:

      • Otherwise:

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

      [edit]Notes

      Compared tostd::equal_to,std::ranges::equal_to additionally requires!= to be valid, and that both argument types are required to be (homogeneously) comparable with themselves (via theequality_comparable_with constraint).

      [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/equal_to&oldid=167647"

      [8]ページ先頭

      ©2009-2025 Movatter.jp