diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-11-08 16:07:32 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-11-08 16:07:32 +0000 |
commit | 7606bd1197e8b097d175639bc0be68833e1ef1df (patch) | |
tree | aab9c7af7885b649144d762d73e89592cb94b93a /libstdc++-v3/testsuite/util/exception | |
parent | 7876e2b5f44e8d961d43f9e0e2b007efebd1d955 (diff) | |
download | gcc-7606bd1197e8b097d175639bc0be68833e1ef1df.zip gcc-7606bd1197e8b097d175639bc0be68833e1ef1df.tar.gz gcc-7606bd1197e8b097d175639bc0be68833e1ef1df.tar.bz2 |
stl_tree.h (_Rb_tree<>::_M_erase_aux): Add.
2010-11-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_tree.h (_Rb_tree<>::_M_erase_aux): Add.
(_Rb_tree<>::erase(iterator)): Fix in C++0x mode to take
const_iterator; remove redundant overload in C++03 mode.
(_Rb_tree<>::erase(iterator, iterator)): Likewise.
* include/bits/stl_map.h (map<>::erase): Adjust.
(map<>::insert): Fix signature in C++0x mode.
* include/bits/stl_set.h (set<>::erase): Likewise.
(set<>::insert): Likewise.
* include/bits/stl_multimap.h (multimap<>::erase): Likewise.
(multimap<>::insert): Likewise.
* include/bits/stl_multiset.h (multiset<>::erase): Likewise.
(multiset<>::insert): Fix signature in C++0x mode.
* include/profile/set.h: Adjust.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/util/exception/safety.h (erase_base, insert_base):
Update.
From-SVN: r166438
Diffstat (limited to 'libstdc++-v3/testsuite/util/exception')
-rw-r--r-- | libstdc++-v3/testsuite/util/exception/safety.h | 176 |
1 files changed, 78 insertions, 98 deletions
diff --git a/libstdc++-v3/testsuite/util/exception/safety.h b/libstdc++-v3/testsuite/util/exception/safety.h index cab31e2..9468bff 100644 --- a/libstdc++-v3/testsuite/util/exception/safety.h +++ b/libstdc++-v3/testsuite/util/exception/safety.h @@ -251,91 +251,93 @@ namespace __gnu_test struct erase_base { typedef typename _Tp::iterator iterator; + typedef typename _Tp::const_iterator const_iterator; - iterator (_Tp::* _F_erase_point)(iterator); - iterator (_Tp::* _F_erase_range)(iterator, iterator); + iterator (_Tp::* _F_erase_point)(const_iterator); + iterator (_Tp::* _F_erase_range)(const_iterator, const_iterator); erase_base() : _F_erase_point(&_Tp::erase), _F_erase_range(&_Tp::erase) { } }; - // Specialization, as forward_list has erase_after. - template<typename _Tp1, typename _Tp2> - struct erase_base<std::forward_list<_Tp1, _Tp2>> + // Specializations, old C++03 signatures. + template<typename _Tp1, typename _Tp2, typename _Tp3> + struct erase_base<std::basic_string<_Tp1, _Tp2, _Tp3>> { - typedef std::forward_list<_Tp1, _Tp2> container_type; + typedef std::basic_string<_Tp1, _Tp2, _Tp3> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - iterator (container_type::* _F_erase_point)(const_iterator); - iterator (container_type::* _F_erase_range)(const_iterator, - const_iterator); + iterator (container_type::* _F_erase_point)(iterator); + iterator (container_type::* _F_erase_range)(iterator, iterator); erase_base() - : _F_erase_point(&container_type::erase_after), - _F_erase_range(&container_type::erase_after) { } + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } }; - // Specializations for the unordered containers. template<typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - struct erase_base<std::unordered_map<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5>> + template <typename, typename, typename> class _Tp4> + struct erase_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> { - typedef std::unordered_map<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5> + typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - iterator (container_type::* _F_erase_point)(const_iterator); - iterator (container_type::* _F_erase_range)(const_iterator, - const_iterator); + iterator (container_type::* _F_erase_point)(iterator); + iterator (container_type::* _F_erase_range)(iterator, iterator); erase_base() : _F_erase_point(&container_type::erase), _F_erase_range(&container_type::erase) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - struct erase_base<std::unordered_multimap<_Tp1, _Tp2, _Tp3, - _Tp4, _Tp5>> + template<typename _Tp1, typename _Tp2> + struct erase_base<std::deque<_Tp1, _Tp2>> { - typedef std::unordered_multimap<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5> - container_type; + typedef std::deque<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - iterator (container_type::* _F_erase_point)(const_iterator); - iterator (container_type::* _F_erase_range)(const_iterator, - const_iterator); + iterator (container_type::* _F_erase_point)(iterator); + iterator (container_type::* _F_erase_range)(iterator, iterator); + + erase_base() + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } + }; + + template<typename _Tp1, typename _Tp2> + struct erase_base<std::list<_Tp1, _Tp2>> + { + typedef std::list<_Tp1, _Tp2> container_type; + typedef typename container_type::iterator iterator; + + iterator (container_type::* _F_erase_point)(iterator); + iterator (container_type::* _F_erase_range)(iterator, iterator); erase_base() : _F_erase_point(&container_type::erase), _F_erase_range(&container_type::erase) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> - struct erase_base<std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4>> + template<typename _Tp1, typename _Tp2> + struct erase_base<std::vector<_Tp1, _Tp2>> { - typedef std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; + typedef std::vector<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - iterator (container_type::* _F_erase_point)(const_iterator); - iterator (container_type::* _F_erase_range)(const_iterator, - const_iterator); + iterator (container_type::* _F_erase_point)(iterator); + iterator (container_type::* _F_erase_range)(iterator, iterator); erase_base() : _F_erase_point(&container_type::erase), _F_erase_range(&container_type::erase) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> - struct erase_base<std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4>> + // Specialization, as forward_list has erase_after. + template<typename _Tp1, typename _Tp2> + struct erase_base<std::forward_list<_Tp1, _Tp2>> { - typedef std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; + typedef std::forward_list<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; typedef typename container_type::const_iterator const_iterator; @@ -344,8 +346,8 @@ namespace __gnu_test const_iterator); erase_base() - : _F_erase_point(&container_type::erase), - _F_erase_range(&container_type::erase) { } + : _F_erase_point(&container_type::erase_after), + _F_erase_range(&container_type::erase_after) { } }; template<typename _Tp, @@ -633,109 +635,87 @@ namespace __gnu_test struct insert_base { typedef typename _Tp::iterator iterator; + typedef typename _Tp::const_iterator const_iterator; typedef typename _Tp::value_type value_type; - iterator (_Tp::* _F_insert_point)(iterator, const value_type&); + iterator (_Tp::* _F_insert_point)(const_iterator, const value_type&); insert_base() : _F_insert_point(&_Tp::insert) { } }; - // Specialization, as string insertion has a different signature. - template<typename _Tp1, typename _Tp2, typename _Tp3> - struct insert_base<std::basic_string<_Tp1, _Tp2, _Tp3>> + // Specializations, old C++03 signatures. + template<typename _Tp1, typename _Tp2> + struct insert_base<std::deque<_Tp1, _Tp2>> { - typedef std::basic_string<_Tp1, _Tp2, _Tp3> container_type; + typedef std::deque<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(iterator, value_type); + iterator (container_type::* _F_insert_point)(iterator, + const value_type&); insert_base() : _F_insert_point(&container_type::insert) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, - template <typename, typename, typename> class _Tp4> - struct insert_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> + template<typename _Tp1, typename _Tp2> + struct insert_base<std::list<_Tp1, _Tp2>> { - typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; + typedef std::list<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(iterator, value_type); + iterator (container_type::* _F_insert_point)(iterator, + const value_type&); insert_base() : _F_insert_point(&container_type::insert) { } }; - // Specialization, as forward_list insertion has a different signature. template<typename _Tp1, typename _Tp2> - struct insert_base<std::forward_list<_Tp1, _Tp2>> + struct insert_base<std::vector<_Tp1, _Tp2>> { - typedef std::forward_list<_Tp1, _Tp2> container_type; + typedef std::vector<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(const_iterator, - const value_type&); - - insert_base() : _F_insert_point(&container_type::insert_after) { } - }; - - // Likewise for the unordered containers. - template<typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - struct insert_base<std::unordered_map<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5>> - { - typedef std::unordered_map<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5> - container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - typedef typename container_type::value_type value_type; - - iterator (container_type::* _F_insert_point)(const_iterator, + iterator (container_type::* _F_insert_point)(iterator, const value_type&); insert_base() : _F_insert_point(&container_type::insert) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - struct insert_base<std::unordered_multimap<_Tp1, _Tp2, _Tp3, - _Tp4, _Tp5>> + // Specialization, as string insertion has a different signature. + template<typename _Tp1, typename _Tp2, typename _Tp3> + struct insert_base<std::basic_string<_Tp1, _Tp2, _Tp3>> { - typedef std::unordered_multimap<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5> - container_type; + typedef std::basic_string<_Tp1, _Tp2, _Tp3> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(const_iterator, - const value_type&); + iterator (container_type::* _F_insert_point)(iterator, value_type); insert_base() : _F_insert_point(&container_type::insert) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> - struct insert_base<std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4>> + // Likewise for __versa_string. + template<typename _Tp1, typename _Tp2, typename _Tp3, + template <typename, typename, typename> class _Tp4> + struct insert_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> { - typedef std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4> + typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4> container_type; typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(const_iterator, - const value_type&); + iterator (container_type::* _F_insert_point)(iterator, value_type); insert_base() : _F_insert_point(&container_type::insert) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> - struct insert_base<std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4>> + // Specialization, as forward_list has insert_after. + template<typename _Tp1, typename _Tp2> + struct insert_base<std::forward_list<_Tp1, _Tp2>> { - typedef std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; + typedef std::forward_list<_Tp1, _Tp2> container_type; typedef typename container_type::iterator iterator; typedef typename container_type::const_iterator const_iterator; typedef typename container_type::value_type value_type; @@ -743,7 +723,7 @@ namespace __gnu_test iterator (container_type::* _F_insert_point)(const_iterator, const value_type&); - insert_base() : _F_insert_point(&container_type::insert) { } + insert_base() : _F_insert_point(&container_type::insert_after) { } }; template<typename _Tp, |