Commit 17da7b37 by Paolo Carlini Committed by Paolo Carlini

stl_tree.h (_Rb_tree<>::_M_const_cast_iter): Add and use it throughout.

2010-11-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_tree.h (_Rb_tree<>::_M_const_cast_iter): Add
	and use it throughout.

From-SVN: r166487
parent a618dbe3
2010-11-09 Paolo Carlini <paolo.carlini@oracle.com> 2010-11-09 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_tree.h (_Rb_tree<>::_M_const_cast_iter): Add
and use it throughout.
2010-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/46385 PR libstdc++/46385
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
line number. line number.
......
...@@ -557,6 +557,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -557,6 +557,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
private: private:
iterator iterator
_M_const_cast_iter(const_iterator __cit)
{ return iterator(static_cast<_Link_type>
(const_cast<_Base_ptr>(__cit._M_node))); }
iterator
_M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y, _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
const value_type& __v); const value_type& __v);
...@@ -719,8 +724,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -719,8 +724,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const_iterator __result = __position; const_iterator __result = __position;
++__result; ++__result;
_M_erase_aux(__position); _M_erase_aux(__position);
return iterator(static_cast<_Link_type> return _M_const_cast_iter(__result);
(const_cast<_Base_ptr>(__result._M_node)));
} }
#else #else
void void
...@@ -737,8 +741,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -737,8 +741,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
erase(const_iterator __first, const_iterator __last) erase(const_iterator __first, const_iterator __last)
{ {
_M_erase_aux(__first, __last); _M_erase_aux(__first, __last);
return iterator(static_cast<_Link_type> return _M_const_cast_iter(__last);
(const_cast<_Base_ptr>(__last._M_node)));
} }
#else #else
void void
...@@ -1279,8 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -1279,8 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
} }
else else
// Equivalent keys. // Equivalent keys.
return iterator(static_cast<_Link_type> return _M_const_cast_iter(__position);
(const_cast<_Base_ptr>(__position._M_node)));
} }
template<typename _Key, typename _Val, typename _KeyOfValue, template<typename _Key, typename _Val, typename _KeyOfValue,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment