public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-4074] libstdc++: Remove useless base classes in pb_db tests
Date: Fri,  1 Oct 2021 19:39:25 +0000 (GMT)	[thread overview]
Message-ID: <20211001193925.ADDCB3857804@sourceware.org> (raw)

https://gcc.gnu.org/g:e3869a48fc2e5fbb9e8eb7058e5176446479673f

commit r12-4074-ge3869a48fc2e5fbb9e8eb7058e5176446479673f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon May 24 18:27:16 2021 +0100

    libstdc++: Remove useless base classes in pb_db tests
    
    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.

Diff:
---
 libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc          | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc                | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc     | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc       | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc    | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc                | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc             | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc         | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc | 4 ++--
 libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc             | 1 -
 libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc              | 4 ++--
 11 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc
index 1d0b49146b9..143f3ee62e3 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/basic_multimap.cc
@@ -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;
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc
index 74ed84676ed..bb8e9c494a5 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/erase_if.cc
@@ -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; }
 
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc
index d045b40654a..73eda50374c 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_illegal_resize.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc
index 0fe99d291ee..a69c9c99bd8 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_initial_size.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc
index 976291fce3f..8f7ed2767db 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_load_set_change.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc
index f57a6ad8bd3..d42e6d87c98 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_mod.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc
index 53c5e26c9b6..f8e4a7b8f9c 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc
index 19fb3d32cc0..0ea02dadc44 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_shift_mask.cc
@@ -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; }
 };
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc
index 1910e2c35e1..d99ebff7010 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_dijkstra.cc
@@ -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
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc
index a5b1898fed7..86c37d41ecc 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/ranged_hash.cc
@@ -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;
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc
index 0bf6b06059b..5dd9cb7c36c 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/store_hash.cc
@@ -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();


                 reply	other threads:[~2021-10-01 19:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211001193925.ADDCB3857804@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).