diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-11-09 13:21:39 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-11-09 13:21:39 +0000 |
commit | 17da7b378333a309bed5b6a21ea4f21fc3986444 (patch) | |
tree | 5fba5c48094ff6a35b15b6a72d512f6816d4ecc0 /libstdc++-v3 | |
parent | a618dbe3697d2f4a0dc14e2868f2d95e2a48888a (diff) | |
download | gcc-17da7b378333a309bed5b6a21ea4f21fc3986444.zip gcc-17da7b378333a309bed5b6a21ea4f21fc3986444.tar.gz gcc-17da7b378333a309bed5b6a21ea4f21fc3986444.tar.bz2 |
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
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 3dfa2c3..7420831 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 b85398d..3ffd996 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, |