2010-11-27 François Dumont <francois.cppdevs@free.fr>

* include/debug/unordered_map, unordered_set (unordered_map<>::insert,
        unordered_multimap<>::insert, unordered_set<>::insert, 
        unordered_multiset<>::insert) Debug check iterator hint and pass it to
        normal implementation.

From-SVN: r167198
This commit is contained in:
François Dumont 2010-11-27 13:51:58 +01:00 committed by François Dumont
parent 2dd24dbdfe
commit d66411ba66
3 changed files with 42 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2010-11-27 François Dumont <francois.cppdevs@free.fr>
* include/debug/unordered_map, unordered_set (unordered_map<>::insert,
unordered_multimap<>::insert, unordered_set<>::insert,
unordered_multiset<>::insert) Debug check iterator hint and pass it to
normal implementation.
2010-11-27 François Dumont <francois.cppdevs@free.fr>
* include/debug/bitset (bitset<>::reference): Clean code, use normal

View File

@ -185,9 +185,10 @@ namespace __debug
}
iterator
insert(const_iterator, const value_type& __obj)
insert(const_iterator __hint, const value_type& __obj)
{
return iterator(_Base::insert(__obj).first, this);
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), __obj), this);
}
template<typename _Pair, typename = typename
@ -205,9 +206,11 @@ namespace __debug
std::enable_if<std::is_convertible<_Pair,
value_type>::value>::type>
iterator
insert(const_iterator, _Pair&& __obj)
insert(const_iterator __hint, _Pair&& __obj)
{
return iterator(_Base::insert(std::forward<_Pair>(__obj)).first,
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(),
std::forward<_Pair>(__obj)),
this);
}
@ -467,8 +470,11 @@ namespace __debug
{ return iterator(_Base::insert(__obj), this); }
iterator
insert(const_iterator, const value_type& __obj)
{ return iterator(_Base::insert(__obj), this); }
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), __obj), this);
}
template<typename _Pair, typename = typename
std::enable_if<std::is_convertible<_Pair,
@ -481,8 +487,13 @@ namespace __debug
std::enable_if<std::is_convertible<_Pair,
value_type>::value>::type>
iterator
insert(const_iterator, _Pair&& __obj)
{ return iterator(_Base::insert(std::forward<_Pair>(__obj)), this); }
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(),
std::forward<_Pair>(__obj)),
this);
}
void
insert(std::initializer_list<value_type> __l)

View File

@ -186,11 +186,10 @@ namespace __debug
}
iterator
insert(const_iterator, const value_type& __obj)
insert(const_iterator __hint, const value_type& __obj)
{
typedef std::pair<_Base_iterator, bool> __pair_type;
__pair_type __res = _Base::insert(__obj);
return iterator(__res.first, this);
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), __obj), this);
}
std::pair<iterator, bool>
@ -202,11 +201,10 @@ namespace __debug
}
iterator
insert(const_iterator, value_type&& __obj)
insert(const_iterator __hint, value_type&& __obj)
{
typedef std::pair<typename _Base::iterator, bool> __pair_type;
__pair_type __res = _Base::insert(std::move(__obj));
return iterator(__res.first, this);
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__obj)), this);
}
void
@ -461,16 +459,22 @@ namespace __debug
{ return iterator(_Base::insert(__obj), this); }
iterator
insert(const_iterator, const value_type& __obj)
{ return iterator(_Base::insert(__obj), this); }
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), __obj), this);
}
iterator
insert(value_type&& __obj)
{ return iterator(_Base::insert(std::move(__obj)), this); }
iterator
insert(const_iterator, value_type&& __obj)
{ return iterator(_Base::insert(std::move(__obj)), this); }
insert(const_iterator __hint, value_type&& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__obj)), this);
}
void
insert(std::initializer_list<value_type> __l)