From 0c3de9003f8e0684664149aec9628c8c5b73d62a Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Thu, 11 Oct 2007 21:48:54 +0000 Subject: [PATCH] Convert ext/hash_map, set to tr1/functional, tr1/unordered_map, set. 2007-10-11 Benjamin Kosnik Convert ext/hash_map, set to tr1/functional, tr1/unordered_map, set. * include/ext/rope: Use tr1/functional hash instead of ext/hash_fun.h. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/precompiled/extc++.h: Remove hash_map, hash_set. * testsuite/util/testsuite_abi.h (__gnu_cxx): Use unordered_map instead of hash_map. Remove hash specialization for string. * testsuite/util/testsuite_abi.cc: Include . * testsuite/util/native_type/assoc/native_hash_set.hpp: Remove hash_set code. * testsuite/util/native_type/assoc/native_hash_map.hpp: Remove hash_map code. * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Change hash_multimap to unordered_multimap. * testsuite/util/testsuite_common_types.h: Remove hash_map, hash_set. * testsuite/ext/headers.cc: Same. * testsuite/17_intro/headers/all_c++200x_compatibility.cc: Remove hash_map.h, hash_set.h. * testsuite/17_intro/headers/all.cc: Same. * testsuite/17_intro/headers/all_pedantic_errors.cc: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Format. * testsuite/util/native_type/assoc/native_set.hpp: Same, update comment. * testsuite/util/native_type/assoc/native_map.hpp: Same. * testsuite/util/native_type/assoc/native_multimap.hpp: Same. * testsuite/util/performance/assoc/timing/ multimap_insert_test.hpp: Same. * testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same. From-SVN: r129243 --- libstdc++-v3/ChangeLog | 31 ++++++++ .../ext/pb_ds/detail/standard_policies.hpp | 73 +++++++------------ libstdc++-v3/include/ext/rope | 22 ++++-- libstdc++-v3/include/precompiled/extc++.h | 2 - .../testsuite/17_intro/headers/all.cc | 2 - .../headers/all_c++200x_compatibility.cc | 2 - .../17_intro/headers/all_pedantic_errors.cc | 2 - libstdc++-v3/testsuite/ext/headers.cc | 4 +- .../native_type/assoc/native_hash_map.hpp | 29 +------- .../assoc/native_hash_multimap.hpp | 30 ++++---- .../native_type/assoc/native_hash_set.hpp | 29 +------- .../util/native_type/assoc/native_map.hpp | 2 +- .../native_type/assoc/native_multimap.hpp | 2 +- .../util/native_type/assoc/native_set.hpp | 2 +- .../assoc/timing/multimap_find_test.hpp | 3 +- .../assoc/timing/multimap_insert_test.hpp | 6 +- libstdc++-v3/testsuite/util/testsuite_abi.cc | 3 +- libstdc++-v3/testsuite/util/testsuite_abi.h | 21 +----- .../testsuite/util/testsuite_common_types.h | 57 ++------------- 19 files changed, 107 insertions(+), 215 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 34c00f7c270a..f5e60e8529ce 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,34 @@ +2007-10-11 Benjamin Kosnik + + Convert ext/hash_map, set to tr1/functional, tr1/unordered_map, set. + * include/ext/rope: Use tr1/functional hash instead of ext/hash_fun.h. + * include/ext/pb_ds/detail/standard_policies.hpp: Same. + * include/precompiled/extc++.h: Remove hash_map, hash_set. + * testsuite/util/testsuite_abi.h (__gnu_cxx): Use unordered_map + instead of hash_map. Remove hash specialization for string. + * testsuite/util/testsuite_abi.cc: Include . + * testsuite/util/native_type/assoc/native_hash_set.hpp: Remove + hash_set code. + * testsuite/util/native_type/assoc/native_hash_map.hpp: Remove + hash_map code. + * testsuite/util/native_type/assoc/native_hash_multimap.hpp: + Change hash_multimap to unordered_multimap. + * testsuite/util/testsuite_common_types.h: Remove hash_map, hash_set. + * testsuite/ext/headers.cc: Same. + * testsuite/17_intro/headers/all_c++200x_compatibility.cc: Remove + hash_map.h, hash_set.h. + * testsuite/17_intro/headers/all.cc: Same. + * testsuite/17_intro/headers/all_pedantic_errors.cc: Same. + + * include/ext/pb_ds/detail/standard_policies.hpp: Format. + * testsuite/util/native_type/assoc/native_set.hpp: Same, + update comment. + * testsuite/util/native_type/assoc/native_map.hpp: Same. + * testsuite/util/native_type/assoc/native_multimap.hpp: Same. + * testsuite/util/performance/assoc/timing/ + multimap_insert_test.hpp: Same. + * testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same. + 2007-10-11 Chris Jefferson Paolo Carlini diff --git a/libstdc++-v3/include/ext/pb_ds/detail/standard_policies.hpp b/libstdc++-v3/include/ext/pb_ds/detail/standard_policies.hpp index bbd91c38d234..47bc143090b9 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/standard_policies.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/standard_policies.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -54,7 +54,7 @@ #include #include #include -#include +#include namespace __gnu_pbds { @@ -63,13 +63,13 @@ namespace __gnu_pbds template struct default_hash_fn { - typedef __gnu_cxx::hash< Key> type; + typedef std::tr1::hash type; }; template struct default_eq_fn { - typedef std::equal_to< Key> type; + typedef std::equal_to type; }; enum @@ -88,27 +88,17 @@ namespace __gnu_pbds private: typedef typename Comb_Hash_Fn::size_type size_type; - typedef - typename __conditional_type< - is_same< - __gnu_pbds::direct_mask_range_hashing< - size_type>, - Comb_Hash_Fn>::value, - __gnu_pbds::hash_exponential_size_policy< - size_type>, - __gnu_pbds::hash_prime_size_policy>::__type - size_policy_type; + typedef __gnu_pbds::direct_mask_range_hashing default_fn; + typedef is_same same_type; + typedef __gnu_pbds::hash_exponential_size_policy iftrue; + typedef __gnu_pbds::hash_prime_size_policy iffalse; + typedef __conditional_type cond_type; + typedef typename cond_type::__type size_policy_type; + + typedef __gnu_pbds::hash_load_check_resize_trigger trigger; public: - typedef - __gnu_pbds::hash_standard_resize_policy< - size_policy_type, - __gnu_pbds::hash_load_check_resize_trigger< - false, - size_type>, - false, - size_type> - type; + typedef __gnu_pbds::hash_standard_resize_policy type; }; struct default_update_policy @@ -122,38 +112,27 @@ namespace __gnu_pbds private: typedef typename Comb_Probe_Fn::size_type size_type; + typedef __gnu_pbds::direct_mask_range_hashing default_fn; + typedef is_same same_type; + typedef __gnu_pbds::linear_probe_fn iftrue; + typedef __gnu_pbds::quadratic_probe_fn iffalse; + typedef __conditional_type cond_type; + public: - typedef - typename __conditional_type< - is_same< - __gnu_pbds::direct_mask_range_hashing, - Comb_Probe_Fn>::value, - __gnu_pbds::linear_probe_fn< - size_type>, - __gnu_pbds::quadratic_probe_fn< - size_type> >::__type - type; + typedef typename cond_type::__type type; }; template struct default_trie_e_access_traits; template - struct default_trie_e_access_traits< - std::basic_string< - Char, - Char_Traits, - std::allocator< - char> > > + struct default_trie_e_access_traits > > { - typedef - __gnu_pbds::string_trie_e_access_traits< - std::basic_string< - Char, - Char_Traits, - std::allocator< - char> > > - type; + private: + typedef std::basic_string > string_type; + + public: + typedef __gnu_pbds::string_trie_e_access_traits type; }; } // namespace detail diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index b5489176c52f..ed1df5bc925b 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -56,8 +56,8 @@ #include #include #include -#include #include +#include # ifdef __GC # define __GC_CONST const @@ -2906,12 +2906,18 @@ protected: swap(rope<_CharT, _Alloc>& __x, rope<_CharT, _Alloc>& __y) { __x.swap(__y); } - // Hash functions should probably be revisited later: +_GLIBCXX_END_NAMESPACE + + +namespace std +{ +namespace tr1 +{ template<> - struct hash + struct hash<__gnu_cxx::crope> { size_t - operator()(const crope& __str) const + operator()(const __gnu_cxx::crope& __str) const { size_t __size = __str.size(); if (0 == __size) @@ -2922,10 +2928,10 @@ protected: template<> - struct hash + struct hash<__gnu_cxx::wrope> { size_t - operator()(const wrope& __str) const + operator()(const __gnu_cxx::wrope& __str) const { size_t __size = __str.size(); if (0 == __size) @@ -2933,8 +2939,8 @@ protected: return 13 * __str[0] + 5 * __str[__size - 1] + __size; } }; - -_GLIBCXX_END_NAMESPACE +} // namespace tr1 +} // namespace std # include diff --git a/libstdc++-v3/include/precompiled/extc++.h b/libstdc++-v3/include/precompiled/extc++.h index 7e8ef025cd6e..8d0b3de90b73 100644 --- a/libstdc++-v3/include/precompiled/extc++.h +++ b/libstdc++-v3/include/precompiled/extc++.h @@ -40,8 +40,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/libstdc++-v3/testsuite/17_intro/headers/all.cc b/libstdc++-v3/testsuite/17_intro/headers/all.cc index c0ef4bfa5f2a..662bad6b10f8 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/all.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/all.cc @@ -117,8 +117,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/libstdc++-v3/testsuite/17_intro/headers/all_c++200x_compatibility.cc b/libstdc++-v3/testsuite/17_intro/headers/all_c++200x_compatibility.cc index 1052cd7cf26e..9410805a0857 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/all_c++200x_compatibility.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/all_c++200x_compatibility.cc @@ -118,8 +118,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc index 1325cc9d3665..2b72a3928a52 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc @@ -118,8 +118,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/libstdc++-v3/testsuite/ext/headers.cc b/libstdc++-v3/testsuite/ext/headers.cc index af66604377e4..a1bdbb350f5b 100644 --- a/libstdc++-v3/testsuite/ext/headers.cc +++ b/libstdc++-v3/testsuite/ext/headers.cc @@ -1,7 +1,7 @@ // { dg-do compile } // 1999-06-23 bkoz -// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. +// Copyright (C) 1999, 2001, 2003, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,8 +33,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_map.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_map.hpp index 7bf1879b4297..5db361106013 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_map.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_map.hpp @@ -41,7 +41,7 @@ /** * @file native_hash_map.hpp - * Contains an adapter to Dinkumware/SGI hash tables + * Contains an adapter to TR1 unordered containers. */ #ifndef PB_DS_NATIVE_HASH_MAP_HPP @@ -52,29 +52,15 @@ #include #include #include - -// Default to using tr1. -#define PB_DS_USE_TR1 1 - -#ifdef PB_DS_USE_TR1 #include -#else -#include -#endif namespace __gnu_pbds { namespace test { -#ifdef PB_DS_USE_TR1 #define PB_DS_BASE_C_DEC \ std::tr1::__unordered_map >::other, Cache_Hash> -#else -#define PB_DS_BASE_C_DEC \ - __gnu_cxx::hash_map >::other> -#endif template::type, typename Eq_Fn = std::equal_to, typename Less_Fn = std::less, - typename Allocator = std::allocator -#ifdef PB_DS_USE_TR1 - , bool Cache_Hash = false -#endif + typename Allocator = std::allocator, bool Cache_Hash = false > class native_hash_map : public PB_DS_BASE_C_DEC { @@ -104,18 +87,13 @@ namespace __gnu_pbds static std::string name() { -#ifdef PB_DS_USE_TR1 return std::string("n_hash_map_") + (Cache_Hash ? std::string("cah") : std::string("ncah")); -#else - return std::string("n_hash_map_ncah"); -#endif } static std::string desc() { -#ifdef PB_DS_USE_TR1 const std::string cache_hash_desc = make_xml_tag("cache_hash_code", "value", @@ -123,9 +101,6 @@ namespace __gnu_pbds return make_xml_tag("type", "value", "std_tr1_unordered_map", cache_hash_desc); -#else - return make_xml_tag("type", "value", "__gnucxx_hash_map"); -#endif } }; diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp index d787bc9bb7ab..b9d5aa19a311 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -41,13 +41,14 @@ /** * @file native_hash_multimap.hpp - * Contains an adapter to Dinkumware/SGI hash tables + * Contains an adapter to TR1 unordered containers. */ #ifndef PB_DS_NATIVE_HASH_MULTIMAP_HPP #define PB_DS_NATIVE_HASH_MULTIMAP_HPP #include +#include #include #include #include @@ -59,32 +60,29 @@ namespace __gnu_pbds namespace test { #define PB_DS_BASE_C_DEC \ - __gnu_cxx::hash_multimap + std::tr1::unordered_multimap template::type, + class Hash_Fn = typename __gnu_pbds::detail::default_hash_fn::type, class Eq_Fn = std::equal_to, class Less_Fn = std::less, class Allocator = std::allocator > class native_hash_multimap : public PB_DS_BASE_C_DEC { private: - typedef PB_DS_BASE_C_DEC base_type; + typedef PB_DS_BASE_C_DEC base_type; + typedef std::pair pair_type; public: - typedef native_hash_tag container_category; - - typedef Allocator allocator; - - typedef typename base_type::iterator iterator; - + typedef native_hash_tag container_category; + typedef Allocator allocator; + typedef typename base_type::iterator iterator; typedef typename base_type::const_iterator const_iterator; typedef - typename Allocator::template rebind< - std::pair >::other::const_reference + typename allocator::template rebind::other::const_reference const_reference; native_hash_multimap() : base_type(Init_Size) @@ -95,7 +93,7 @@ namespace __gnu_pbds { } inline void - insert(typename base_type::const_reference r_val) + insert(const_reference r_val) { typedef std::pair eq_range_t; eq_range_t f = base_type::equal_range(r_val.first); @@ -148,9 +146,7 @@ namespace __gnu_pbds static std::string desc() - { - return make_xml_tag("type", "value", "__gnucxx_hash_multimap"); - } + { return make_xml_tag("type", "value", "__gnucxx_hash_multimap"); } }; #undef PB_DS_BASE_C_DEC diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_set.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_set.hpp index 52d1aa13787d..86ad2482132a 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_set.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_set.hpp @@ -41,7 +41,7 @@ /** * @file native_hash_set.hpp - * Contains an adapter to Dinkumware/SGI hash tables + * Contains an adapter to TR1 unordered containers. */ #ifndef PB_DS_NATIVE_HASH_SET_HPP @@ -52,39 +52,22 @@ #include #include #include - -// Default to using tr1. -#define PB_DS_USE_TR1 1 - -#ifdef PB_DS_USE_TR1 #include -#else -#include -#endif namespace __gnu_pbds { namespace test { -#ifdef PB_DS_USE_TR1 #define PB_DS_BASE_C_DEC \ std::tr1::__unordered_set::other, Cache_Hash> -#else -#define PB_DS_BASE_C_DEC \ - __gnu_cxx::hash_set::other> -#endif template::type, typename Eq_Fn = std::equal_to, typename Less_Fn = std::less, - typename Allocator = std::allocator -#ifdef PB_DS_USE_TR1 - , bool Cache_Hash = false -#endif + typename Allocator = std::allocator, bool Cache_Hash = false > class native_hash_set : public PB_DS_BASE_C_DEC { @@ -129,27 +112,19 @@ namespace __gnu_pbds static std::string name() { -#ifdef PB_DS_USE_TR1 return std::string("n_hash_set_") + (Cache_Hash ? std::string("cah") : std::string("ncah")); -#else - return std::string("n_hash_set_ncah"); -#endif } static std::string desc() { -#ifdef PB_DS_USE_TR1 const std::string cache_hash_desc = make_xml_tag("cache_hash_code", "value", Cache_Hash ? std::string("true") : std::string("false")); return make_xml_tag("type", "value", "std_tr1_unordered_set", cache_hash_desc); -#else - return make_xml_tag("type", "value", "__gnucxx_hash_set"); -#endif } }; diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_map.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_map.hpp index babe038d2809..1be7ee5984fc 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_map.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_map.hpp @@ -41,7 +41,7 @@ /** * @file native_map.hpp - * Contains an adapter to Dinkumware/SGI tree tables + * Contains an adapter to std::map */ #ifndef PB_DS_NATIVE_MAP_HPP diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp index 2bec37473df7..906fca3244ec 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp @@ -41,7 +41,7 @@ /** * @file native_multimap.hpp - * Contains an adapter to Dinkumware/SGI tables + * Contains an adapter to std::multimap */ #ifndef PB_DS_NATIVE_MULTIMAP_HPP diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_set.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_set.hpp index c605ac6b18df..b25f2bac29e4 100644 --- a/libstdc++-v3/testsuite/util/native_type/assoc/native_set.hpp +++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_set.hpp @@ -41,7 +41,7 @@ /** * @file native_set.hpp - * Contains an adapter to Dinkumware/SGI tree tables + * Contains an adapter to std::set */ #ifndef PB_DS_NATIVE_SET_HPP diff --git a/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_find_test.hpp b/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_find_test.hpp index efd5997bf54d..4d639d38c4e4 100644 --- a/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_find_test.hpp +++ b/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_find_test.hpp @@ -128,7 +128,8 @@ namespace __gnu_pbds template - class multimap_find_test : private __gnu_pbds::test::detail::timing_test_base + class multimap_find_test + : private __gnu_pbds::test::detail::timing_test_base { public: multimap_find_test(It ins_b, size_t ins_vn, size_t vs, size_t ins_vm) diff --git a/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_insert_test.hpp b/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_insert_test.hpp index bbdc2455c94f..f35d95217b5f 100644 --- a/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_insert_test.hpp +++ b/libstdc++-v3/testsuite/util/performance/assoc/timing/multimap_insert_test.hpp @@ -97,7 +97,7 @@ namespace __gnu_pbds { Cntnr cntnr; for (It ins_it = m_ins_it_b; ins_it != m_ins_it_e; ++ins_it) - cntnr.insert((typename Cntnr::const_reference)(*ins_it)); + cntnr.insert((typename Cntnr::const_reference)(*ins_it)); } } @@ -108,7 +108,8 @@ namespace __gnu_pbds } // namespace detail template - class multimap_insert_test : private __gnu_pbds::test::detail::timing_test_base + class multimap_insert_test + : private __gnu_pbds::test::detail::timing_test_base { public: multimap_insert_test(It b, size_t ins_vn, size_t ins_vs, size_t ins_vm) @@ -122,7 +123,6 @@ namespace __gnu_pbds private: multimap_insert_test(const multimap_insert_test&); - private: const It m_ins_b; const size_t m_ins_vn; const size_t m_ins_vs; diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc index 44e10ac4ba02..6efabecbe23c 100644 --- a/libstdc++-v3/testsuite/util/testsuite_abi.cc +++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc @@ -30,10 +30,11 @@ // Benjamin Kosnik #include "testsuite_abi.h" +#include #include #include #include -#include +#include using namespace std; diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.h b/libstdc++-v3/testsuite/util/testsuite_abi.h index 89825a875ab1..a659ef4a7429 100644 --- a/libstdc++-v3/testsuite/util/testsuite_abi.h +++ b/libstdc++-v3/testsuite/util/testsuite_abi.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include // Encapsulates symbol characteristics. @@ -75,7 +75,7 @@ struct symbol init(std::string& data); }; -typedef __gnu_cxx::hash_map symbol_objects; +typedef std::tr1::unordered_map symbol_objects; typedef std::deque symbol_names; @@ -110,20 +110,3 @@ create_symbols(const char* file); const char* demangle(const std::string& mangled); - - -// Specialization. -namespace __gnu_cxx -{ - using namespace std; - - template<> - struct hash - { - size_t operator()(const string& s) const - { - const collate& c = use_facet >(locale::classic()); - return c.hash(s.c_str(), s.c_str() + s.size()); - } - }; -} diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index bcb36e71f0f4..b560ae3a0ac9 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -1,7 +1,7 @@ // -*- C++ -*- // typelist for the C++ library testsuite. // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2005, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -47,8 +47,7 @@ #include #include -#include -#include +#include #include #include @@ -160,7 +159,7 @@ namespace __gnu_test typedef typename append::type type; }; - // Typelists for map, set, hash_map, hash_set, unordered_set, unordered_map. + // Typelists for map, set, unordered_set, unordered_map. template struct maps { @@ -181,26 +180,6 @@ namespace __gnu_test typedef typename transform::type type; }; - template - struct hash_maps - { - typedef Tp value_type; - typedef Tp key_type; - typedef __gnu_cxx::hash hash_function; - typedef std::equal_to equality_function; - - template - struct container - { - typedef Tl allocator_type; - typedef __gnu_cxx::hash_map type; - }; - - typedef allocator_policies allocator_types; - typedef typename allocator_types::type allocator_typelist; - typedef typename transform::type type; - }; - template struct unordered_maps { @@ -241,26 +220,6 @@ namespace __gnu_test typedef typename transform::type type; }; - template - struct hash_sets - { - typedef Tp value_type; - typedef Tp key_type; - typedef __gnu_cxx::hash hash_function; - typedef std::equal_to equality_function; - - template - struct container - { - typedef Tl allocator_type; - typedef __gnu_cxx::hash_set type; - }; - - typedef allocator_policies allocator_types; - typedef typename allocator_types::type allocator_typelist; - typedef typename transform::type type; - }; - template struct unordered_sets { @@ -291,16 +250,12 @@ namespace __gnu_test typedef typename maps::type map_typelist; typedef typename sets::type set_typelist; - typedef typename hash_maps::type hash_map_typelist; - typedef typename hash_sets::type hash_set_typelist; typedef typename unordered_maps::type unordered_map_typelist; typedef typename unordered_sets::type unordered_set_typelist; - typedef typename append::type a1; - typedef typename append::type a2; - typedef typename append::type a3; - typedef typename append::type a4; - typedef typename append::type type; + typedef typename append::type a1; + typedef typename append::type a2; + typedef typename append::type type; }; } // namespace __gnu_test -- 2.47.2