diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-09 13:21:39 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-09 13:21:39 +0000 |
commit | e33a69b8ba10d878c6c402f5b7d098682af67234 (patch) | |
tree | 5fba5c48094ff6a35b15b6a72d512f6816d4ecc0 /libstdc++-v3 | |
parent | 04fd90939d445ad925d6fa7a2e93e9a93dfcad3a (diff) | |
download | gcc-e33a69b8ba10d878c6c402f5b7d098682af67234.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_tree.h | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3dfa2c3b147..742083107b0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 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 * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error line number. diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index b85398de3f3..3ffd996ae93 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -557,6 +557,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) private: 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, const value_type& __v); @@ -719,8 +724,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const_iterator __result = __position; ++__result; _M_erase_aux(__position); - return iterator(static_cast<_Link_type> - (const_cast<_Base_ptr>(__result._M_node))); + return _M_const_cast_iter(__result); } #else void @@ -737,8 +741,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) erase(const_iterator __first, const_iterator __last) { _M_erase_aux(__first, __last); - return iterator(static_cast<_Link_type> - (const_cast<_Base_ptr>(__last._M_node))); + return _M_const_cast_iter(__last); } #else void @@ -1279,8 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } else // Equivalent keys. - return iterator(static_cast<_Link_type> - (const_cast<_Base_ptr>(__position._M_node))); + return _M_const_cast_iter(__position); } template<typename _Key, typename _Val, typename _KeyOfValue, |