[PATCH] Removing unused, non-standard function in _Rb_tree

2019-05-14 Thread Jonathan Wakely

* include/bits/stl_tree.h (_Rb_tree::erase(const Key*, const Key*)):
Remove unused, non-standard function.

As suggested in https://gcc.gnu.org/ml/libstdc++/2016-12/msg00100.html
I've removed this unused member.

Tested powerpc64le-linux, committed to trunk.


commit 4a182e12a8255450650b890cc378f57d37d194cf
Author: redi 
Date:   Tue May 14 12:19:10 2019 +

Removing unused, non-standard function in _Rb_tree

* include/bits/stl_tree.h (_Rb_tree::erase(const Key*, const Key*)):
Remove unused, non-standard function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271168 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/include/bits/stl_tree.h 
b/libstdc++-v3/include/bits/stl_tree.h
index 7545ade3f7b..00e4a0cccbf 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -1231,6 +1231,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_erase_aux(__position);
   }
 #endif
+
   size_type
   erase(const key_type& __x);
 
@@ -1253,8 +1254,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   erase(const_iterator __first, const_iterator __last)
   { _M_erase_aux(__first, __last); }
 #endif
-  void
-  erase(const key_type* __first, const key_type* __last);
 
   void
   clear() _GLIBCXX_NOEXCEPT
@@ -2533,16 +2532,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   return __old_size - size();
 }
 
-  template
-void
-_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
-erase(const _Key* __first, const _Key* __last)
-{
-  while (__first != __last)
-   erase(*__first++);
-}
-
   template
 typename _Rb_tree<_Key, _Val, _KeyOfValue,


[PATCH] Removing unused, non-standard function in _Rb_tree

2018-05-02 Thread Jonathan Wakely

We have an unused overload of _Rb_tree::erase which takes a pair of
pointers (not iterators, pointers) to keys and calls erase for every
key in the range.


It's not actually doing any harm, as the function is only on the
internal _Rb_tree type. It's not exposed as a member of std::map,
std::set etc. but it also isn't used anywhere, and I can't think where
it would be useful, so I propose to remove it.

Shout if you think we want to keep it.

* include/bits/stl_tree.h (_Rb_tree::erase(const Key*, const Key*)):
Remove unused, non-standard function.


commit 55b189d088ee1e343a9569234debeae82ce4005d
Author: Jonathan Wakely 
Date:   Fri Dec 16 13:51:44 2016 +

Removing unused, non-standard function in _Rb_tree

* include/bits/stl_tree.h (_Rb_tree::erase(const Key*, const Key*)):
Remove unused, non-standard function.

diff --git a/libstdc++-v3/include/bits/stl_tree.h 
b/libstdc++-v3/include/bits/stl_tree.h
index d0a8448eb0b..1c0fb97e028 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -1156,6 +1156,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_erase_aux(__position);
   }
 #endif
+
   size_type
   erase(const key_type& __x);
 
@@ -1178,8 +1179,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   erase(const_iterator __first, const_iterator __last)
   { _M_erase_aux(__first, __last); }
 #endif
-  void
-  erase(const key_type* __first, const key_type* __last);
 
   void
   clear() _GLIBCXX_NOEXCEPT
@@ -2521,16 +2520,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template
-void
-_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
-erase(const _Key* __first, const _Key* __last)
-{
-  while (__first != __last)
-   erase(*__first++);
-}
-
-  template
 typename _Rb_tree<_Key, _Val, _KeyOfValue,
  _Compare, _Alloc>::iterator
 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::