OSDN Git Service

2011-11-23 François Dumont <fdumont@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / debug / unordered_set
index 981db4a..2f41bc3 100644 (file)
@@ -35,7 +35,7 @@
 #else
 # include <unordered_set>
 
-#include <debug/safe_unordered_sequence.h>
+#include <debug/safe_unordered_container.h>
 #include <debug/safe_iterator.h>
 #include <debug/safe_local_iterator.h>
 
@@ -50,12 +50,12 @@ namespace __debug
           typename _Alloc = std::allocator<_Value> >
     class unordered_set
     : public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>,
-      public __gnu_debug::_Safe_unordered_sequence<unordered_set<_Value, _Hash,
+      public __gnu_debug::_Safe_unordered_container<unordered_set<_Value, _Hash,
                                                       _Pred, _Alloc> >
     {
       typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash,
                                            _Pred, _Alloc> _Base;
-      typedef __gnu_debug::_Safe_unordered_sequence<unordered_set> _Safe_base;
+      typedef __gnu_debug::_Safe_unordered_container<unordered_set> _Safe_base;
       typedef typename _Base::const_iterator _Base_const_iterator;
       typedef typename _Base::iterator _Base_iterator;
       typedef typename _Base::const_local_iterator _Base_const_local_iterator;
@@ -104,8 +104,6 @@ namespace __debug
       : _Base(__x) { }
 
       unordered_set(unordered_set&& __x)
-      noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
-                     is_nothrow_copy_constructible<_Pred>>::value)
       : _Base(std::move(__x)) { }
 
       unordered_set(initializer_list<value_type> __l,
@@ -332,6 +330,10 @@ namespace __debug
       }
 
       iterator
+      erase(iterator __it)
+      { return erase(const_iterator(__it)); }
+
+      iterator
       erase(const_iterator __first, const_iterator __last)
       {
        __glibcxx_check_erase_range(__first, __last);
@@ -392,11 +394,11 @@ namespace __debug
 
       static _Base_local_iterator
       _S_to_local(_Base_iterator __it)
-      { return _Base_local_iterator(__it._M_cur_node); }
+      { return _Base_local_iterator(__it._M_cur); }
 
       static _Base_const_local_iterator
       _S_to_local(_Base_const_iterator __it)
-      { return _Base_const_local_iterator(__it._M_cur_node); }
+      { return _Base_const_local_iterator(__it._M_cur); }
     };
 
   template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
@@ -425,12 +427,12 @@ namespace __debug
           typename _Alloc = std::allocator<_Value> >
     class unordered_multiset
     : public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
-      public __gnu_debug::_Safe_unordered_sequence<
+      public __gnu_debug::_Safe_unordered_container<
                unordered_multiset<_Value, _Hash, _Pred, _Alloc> >
     {
       typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash,
                                                 _Pred, _Alloc> _Base;
-      typedef __gnu_debug::_Safe_unordered_sequence<unordered_multiset>
+      typedef __gnu_debug::_Safe_unordered_container<unordered_multiset>
                _Safe_base;
       typedef typename _Base::const_iterator _Base_const_iterator;
       typedef typename _Base::iterator _Base_iterator;
@@ -480,8 +482,6 @@ namespace __debug
       : _Base(__x) { }
 
       unordered_multiset(unordered_multiset&& __x)
-      noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
-                     is_nothrow_copy_constructible<_Pred>>::value)
       : _Base(std::move(__x)) { }
 
       unordered_multiset(initializer_list<value_type> __l,
@@ -700,6 +700,10 @@ namespace __debug
       }
 
       iterator
+      erase(iterator __it)
+      { return erase(const_iterator(__it)); }
+
+      iterator
       erase(const_iterator __first, const_iterator __last)
       {
        __glibcxx_check_erase_range(__first, __last);
@@ -755,11 +759,11 @@ namespace __debug
 
       static _Base_local_iterator
       _S_to_local(_Base_iterator __it)
-      { return _Base_local_iterator(__it._M_cur_node); }
+      { return _Base_local_iterator(__it._M_cur); }
 
       static _Base_const_local_iterator
       _S_to_local(_Base_const_iterator __it)
-      { return _Base_const_local_iterator(__it._M_cur_node); }
+      { return _Base_const_local_iterator(__it._M_cur); }
     };
 
   template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>