From: Jonathan Wakely Date: Wed, 13 Nov 2024 13:38:45 +0000 (+0000) Subject: libstdc++: Stop using std::unary_function in perf tests X-Git-Tag: basepoints/gcc-16~4346 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8586e16154f17df56ba6008c2ffe104bd03dd698;p=thirdparty%2Fgcc.git libstdc++: Stop using std::unary_function in perf tests 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. --- diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc index d011e753b9d7..e2337a20929c 100644 --- a/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc +++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc @@ -45,8 +45,11 @@ #include #include -struct int_hash : public std::unary_function +struct int_hash { + typedef int result_type; + typedef int argument_type; + inline int operator()(int i) const { return i; } diff --git a/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp b/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp index 3a38be4ba5ba..8186042b2a35 100644 --- a/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp +++ b/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp @@ -46,8 +46,11 @@ namespace __gnu_pbds { namespace detail { - struct int_hash : public std::unary_function + struct int_hash { + typedef size_t result_type; + typedef int argument_type; + inline size_t operator()(const int i) const { return (static_cast(i)); }