From 3b2524b12683ad95e582a4fc74ae19c6927a398d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 10 Feb 2010 16:09:42 +0000 Subject: hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661 --- libstdc++-v3/testsuite/util/exception/safety.h | 140 ++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 2 deletions(-) (limited to 'libstdc++-v3/testsuite/util/exception') diff --git a/libstdc++-v3/testsuite/util/exception/safety.h b/libstdc++-v3/testsuite/util/exception/safety.h index 4be5318..23862bc 100644 --- a/libstdc++-v3/testsuite/util/exception/safety.h +++ b/libstdc++-v3/testsuite/util/exception/safety.h @@ -275,6 +275,78 @@ namespace __gnu_test _F_erase_range(&container_type::erase_after) { } }; + // Specializations for the unordered containers. + template + struct erase_base> + { + 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; + + iterator (container_type::* _F_erase_point)(const_iterator); + iterator (container_type::* _F_erase_range)(const_iterator, + const_iterator); + + erase_base() + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } + }; + + template + struct erase_base> + { + typedef std::unordered_multimap<_Tp1, _Tp2, _Tp3, _Tp4, _Tp5> + 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); + + erase_base() + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } + }; + + template + struct erase_base> + { + typedef std::unordered_set<_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); + + erase_base() + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } + }; + + template + struct erase_base> + { + typedef std::unordered_multiset<_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); + + erase_base() + : _F_erase_point(&container_type::erase), + _F_erase_range(&container_type::erase) { } + }; + template::has_erase::value> struct erase_point : public erase_base<_Tp> { @@ -532,15 +604,79 @@ namespace __gnu_test { 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::const_iterator const_iterator; typedef typename container_type::value_type value_type; iterator (container_type::* _F_insert_point)(const_iterator, - const value_type&); + const value_type&); insert_base() : _F_insert_point(&container_type::insert_after) { } }; + // Likewise for the unordered containers. + template + struct insert_base> + { + 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, + const value_type&); + + insert_base() : _F_insert_point(&container_type::insert) { } + }; + + template + struct insert_base> + { + typedef std::unordered_multimap<_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, + const value_type&); + + insert_base() : _F_insert_point(&container_type::insert) { } + }; + + template + struct insert_base> + { + typedef std::unordered_set<_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&); + + insert_base() : _F_insert_point(&container_type::insert) { } + }; + + template + struct insert_base> + { + typedef std::unordered_multiset<_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&); + + insert_base() : _F_insert_point(&container_type::insert) { } + }; + template::has_insert::value> struct insert_point : public insert_base<_Tp> { -- cgit v1.1