]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove useless base classes in pb_db tests
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 May 2021 17:27:16 +0000 (18:27 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 1 Oct 2021 19:36:54 +0000 (20:36 +0100)
These function objects do not need to be adaptable, so stop deriving
from deprecated classes. Also the 'inline' keyword is redundant on
member functions defined in the class body.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* testsuite/ext/pb_ds/example/basic_multimap.cc: Remove
unnecesary derivation from std::unary_function.
* testsuite/ext/pb_ds/example/erase_if.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_illegal_resize.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_initial_size.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_load_set_change.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_mod.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_resize.cc: Likewise.
* testsuite/ext/pb_ds/example/hash_shift_mask.cc: Likewise.
* testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc:
Likewise.
* testsuite/ext/pb_ds/example/ranged_hash.cc: Likewise.
* testsuite/ext/pb_ds/example/store_hash.cc: Likewise.

libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc
libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc
libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc
libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc
libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc
libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc

index 1d0b49146b9ce593fbfa0921f6f67c15a9202aa4..143f3ee62e37100f1e8c51f7250c1922786fa05f 100644 (file)
@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct string_hash : public unary_function<string, size_t>
+struct string_hash
 {
-  inline size_t
+  size_t
   operator()(const string& r_s) const
   {
     size_t ret = 0;
index 74ed84676ed196b5de70b6567c0c577eb8b2d6cc..bb8e9c494a5eccc80aa198e7a48f776fd4618705 100644 (file)
@@ -48,7 +48,7 @@ using namespace __gnu_pbds;
 
 // The following functor takes a map's value-type object and returns
 // whether its key is between two numbers.
-struct between : public unary_function<pair<const int, char>, bool>
+struct between
 {
   // Constructor taking two numbers determining a range.
   between(int b, int e) : m_b(b), m_e(e)
@@ -56,7 +56,7 @@ struct between : public unary_function<pair<const int, char>, bool>
 
   // Operator determining whether a value-type object's key is within
   // the range.
-  inline bool
+  bool
   operator()(const pair<const int, char>& r_val)
   { return r_val.first >= m_b&&  r_val.first < m_e; }
 
index d045b40654aaf8aa54450a855c277eadfb3f37ec..73eda50374c8392c68f9d8627f2dddf46f769c10 100644 (file)
@@ -62,9 +62,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
 {
-  inline size_t
+  size_t
   operator()(const int& r_i) const
   { return r_i; }
 };
index 0fe99d291ee8f665ea3d5c00e742866d3a88e450..a69c9c99bd8f7c2045fc99bb9024def320261a64 100644 (file)
@@ -49,9 +49,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
 {
-  inline size_t
+  size_t
   operator()(const int& r_i) const
   { return r_i; }
 };
index 976291fce3f785148116efa68511ca392223d71a..8f7ed2767db7fd89e10c9dd5f1f1babc9d8bc401 100644 (file)
@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
 {
-  inline size_t
+  size_t
   operator()(int i) const
   { return i; }
 };
index f57a6ad8bd3694c434753022403fe55181d41c8d..d42e6d87c98e9904c8c1eec0bed28206060512a5 100644 (file)
@@ -49,9 +49,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
 {
-  inline size_t
+  size_t
   operator()(int i) const
   { return i; }
 };
index 53c5e26c9b640b203406dc487008e5dd33f6ec60..f8e4a7b8f9c3b539e5b3f414f36113bb9d4c8a52 100644 (file)
@@ -50,9 +50,9 @@ using namespace __gnu_pbds;
 // A simple hash functor.
 // hash could serve instead of this functor, but it is not yet
 // standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
 {
-  inline size_t
+  size_t
   operator()(const int& r_i) const
   { return r_i; }
 };
index 19fb3d32cc0aca7907a471b1446e80fa903c6fbb..0ea02dadc443dc2862b1bf0c65b353e3b6f2d16b 100644 (file)
@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
 
 // A simple hash functor. hash could serve instead of this functor,
 // but it is not yet standard everywhere.
-struct simple_int_hash : public unary_function<int, size_t>
+struct simple_int_hash
 {
-  inline size_t
+  size_t
   operator()(int i) const
   { return i; }
 };
index 1910e2c35e17d8b014b64f2ffba2977c59573642..d99ebff7010135e7170a603d7d1771340970d409 100644 (file)
@@ -61,9 +61,9 @@ using namespace __gnu_pbds;
 typedef std::pair<size_t, size_t> pq_value;
 
 // Comparison functor used to compare priority-queue value types.
-struct pq_value_cmp : public binary_function<pq_value, pq_value, bool>
+struct pq_value_cmp
 {
-  inline bool
+  bool
   operator()(const pq_value& r_lhs, const pq_value& r_rhs) const
   {
     // Note that a value is considered smaller than a different value
index a5b1898fed75148276b52af4e34bc2920441e5a6..86c37d41ecc24b17627081c22e6994fab64e3d64 100644 (file)
@@ -60,7 +60,6 @@ using namespace __gnu_pbds;
  * for larger sizes it uses a more complicated hash function.
  */
 class simple_string_ranged_hash_fn 
-  : public unary_function<string, size_t>
 {
 public:
   typedef size_t size_type;
index 0bf6b06059b7779cc128dd347f31ac2b491ce42f..5dd9cb7c36cf731fa78cd9bb60ea5e82098b9509 100644 (file)
@@ -53,9 +53,9 @@ using namespace std;
 using namespace __gnu_pbds;
 
 // A string hash functor.
-struct string_hash : public unary_function<string, size_t>
+struct string_hash
 {
-  inline size_t
+  size_t
   operator()(string str) const
   {
     string::const_iterator b = str.begin();