diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-02-10 16:09:42 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-02-10 16:09:42 +0000 |
commit | 3b2524b12683ad95e582a4fc74ae19c6927a398d (patch) | |
tree | 88ec53b5787238bd38592fc81959492719765e0c /libstdc++-v3/testsuite/util/exception | |
parent | 45406a12e9b888ad287fd56f279591718ac2ac2b (diff) | |
download | gcc-3b2524b12683ad95e582a4fc74ae19c6927a398d.zip gcc-3b2524b12683ad95e582a4fc74ae19c6927a398d.tar.gz gcc-3b2524b12683ad95e582a4fc74ae19c6927a398d.tar.bz2 |
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use.
2010-02-10 Paolo Carlini <paolo.carlini@oracle.com>
* 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
Diffstat (limited to 'libstdc++-v3/testsuite/util/exception')
-rw-r--r-- | libstdc++-v3/testsuite/util/exception/safety.h | 140 |
1 files changed, 138 insertions, 2 deletions
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<typename _Tp1, typename _Tp2, typename _Tp3, + typename _Tp4, typename _Tp5> + struct erase_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; + + 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<typename _Tp1, typename _Tp2, typename _Tp3, + typename _Tp4, typename _Tp5> + struct erase_base<std::unordered_multimap<_Tp1, _Tp2, _Tp3, + _Tp4, _Tp5>> + { + 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<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> + struct erase_base<std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4>> + { + 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<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> + struct erase_base<std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4>> + { + 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<typename _Tp, bool = traits<_Tp>::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<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, + 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>> + { + 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<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> + struct insert_base<std::unordered_set<_Tp1, _Tp2, _Tp3, _Tp4>> + { + 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<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4> + struct insert_base<std::unordered_multiset<_Tp1, _Tp2, _Tp3, _Tp4>> + { + 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<typename _Tp, bool = traits<_Tp>::has_insert::value> struct insert_point : public insert_base<_Tp> { |