]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Stop using std::unary_function in perf tests
authorJonathan Wakely <jwakely@redhat.com>
Wed, 13 Nov 2024 13:38:45 +0000 (13:38 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 13 Nov 2024 17:58:50 +0000 (17:58 +0000)
This fixes some -Wdeprecated-declarations warnings.

libstdc++-v3/ChangeLog:

* testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc: Replace
std::unary_function with result_type and argument_type typedefs.
* testsuite/util/performance/assoc/multimap_common_type.hpp:
Likewise.

libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc
libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp

index d011e753b9d7ab8b9c94c7f60d5c4862e8b27e89..e2337a20929cbad770c71e4c873194c20f4e653a 100644 (file)
 #include <vector>
 #include <functional>
 
-struct int_hash : public std::unary_function<int, int>
+struct int_hash
 {
+  typedef int result_type;
+  typedef int argument_type;
+
   inline int
   operator()(int i) const
   { return i; }
index 3a38be4ba5bab86b25b6f6646ef225c7c86b6a60..8186042b2a3528b50d1a2f99a86a90a4e327e7da 100644 (file)
@@ -46,8 +46,11 @@ namespace __gnu_pbds
   {
     namespace detail
     {
-      struct int_hash : public std::unary_function<int, size_t>
+      struct int_hash
       {
+       typedef size_t result_type;
+       typedef int argument_type;
+
        inline size_t
         operator()(const int i) const
        { return (static_cast<size_t>(i)); }