summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/util/common_type
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/util/common_type
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libstdc++-v3/testsuite/util/common_type')
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/common_type.hpp799
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp98
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp255
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp97
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp99
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp93
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp95
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp82
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp141
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/native_set.hpp84
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/string_form.hpp179
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/template_policy.hpp145
-rw-r--r--libstdc++-v3/testsuite/util/common_type/priority_queue/common_type.hpp75
-rw-r--r--libstdc++-v3/testsuite/util/common_type/priority_queue/detail/ds_string_form.hpp130
-rw-r--r--libstdc++-v3/testsuite/util/common_type/priority_queue/string_form.hpp99
18 files changed, 2690 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/common_type.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/common_type.hpp
new file mode 100644
index 000000000..562f418fa
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/common_type.hpp
@@ -0,0 +1,799 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file common_type.hpp
+ * Contains common types.
+ */
+
+#ifndef PB_DS_COMMON_TYPES_ASSOC_HPP
+#define PB_DS_COMMON_TYPES_ASSOC_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <ext/pb_ds/assoc_container.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ template<typename Key,
+ typename Data,
+ class Hash_Fn = typename __gnu_pbds::detail::default_hash_fn<Key>::type,
+ class Eq_Fn = std::equal_to<Key>,
+ class Allocator = std::allocator<std::pair<const Key, Data> > >
+ struct hash_common_types
+ {
+ private:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ 1, 8,
+ 1, 2,
+ false>
+ no_access_half_load_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ 1, 8,
+ 1, 2,
+ true>
+ access_half_load_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ 1, 8,
+ 1, 1,
+ false>
+ no_access_one_load_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::test::cc_hash_max_collision_check_resize_trigger_t_<
+ Allocator,
+ 1, 2,
+ false>
+ no_access_half_max_col_check_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::test::cc_hash_max_collision_check_resize_trigger_t_<
+ Allocator,
+ 1, 2,
+ true>
+ access_half_max_col_check_check_resize_trigger_policy;
+
+ typedef __gnu_pbds::test::linear_probe_fn_t_<Key, Allocator> lin_p_t;
+
+ typedef __gnu_pbds::test::quadratic_probe_fn_t_<Key, Allocator> quad_p_t;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ performance_cc_policy0;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_prime_size_policy_t_>::type
+ performance_cc_policy1;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ no_access_one_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ performance_cc_policy2;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator>,
+ no_access_one_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_prime_size_policy_t_ >::type
+ performance_cc_policy3;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::true_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ performance_cc_policy4;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ no_access_half_max_col_check_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ performance_cc_policy5;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ access_half_max_col_check_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ regression_cc_policy0;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::false_type,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ regression_cc_policy1;
+
+ typedef
+ typename __gnu_cxx::typelist::create4<
+ __gnu_pbds::detail::true_type,
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_prime_size_policy_t_ >::type
+ regression_cc_policy2;
+
+ typedef
+ typename __gnu_cxx::typelist::create5<
+ __gnu_pbds::detail::false_type,
+ lin_p_t,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ performance_gp_policy0;
+
+ typedef
+ typename __gnu_cxx::typelist::create5<
+ __gnu_pbds::detail::false_type,
+ quad_p_t,
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_prime_size_policy_t_ >::type
+ performance_gp_policy1;
+
+ typedef
+ typename __gnu_cxx::typelist::create5<
+ __gnu_pbds::detail::false_type,
+ quad_p_t,
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator>,
+ access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_prime_size_policy_t_>::type
+ regression_gp_policy0;
+
+ typedef
+ typename __gnu_cxx::typelist::create5<
+ __gnu_pbds::detail::true_type,
+ lin_p_t,
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator>,
+ access_half_load_check_resize_trigger_policy,
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator> >::type
+ regression_gp_policy1;
+
+ typedef
+ typename __gnu_cxx::typelist::create6<
+ performance_cc_policy0,
+ performance_cc_policy1,
+ performance_cc_policy2,
+ performance_cc_policy3,
+ performance_cc_policy4,
+ performance_cc_policy5>::type
+ performance_cc_range_hashing_policies;
+
+ typedef
+ typename __gnu_cxx::typelist::create3<
+ regression_cc_policy0,
+ regression_cc_policy1,
+ regression_cc_policy2>::type
+ regression_cc_range_hashing_policies;
+
+ typedef
+ typename __gnu_cxx::typelist::create2<
+ performance_gp_policy0,
+ performance_gp_policy1>::type
+ performance_gp_range_hashing_policies;
+
+ typedef
+ typename __gnu_cxx::typelist::create2<
+ regression_gp_policy0,
+ regression_gp_policy1>::type
+ regression_gp_range_hashing_policies;
+
+ template<typename Policy_Tl>
+ struct no_access_generic_cc_hash_table_t
+ {
+ private:
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 0>::type
+ store_hash_indicator;
+
+ enum
+ {
+ store_hash = store_hash_indicator::value
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 1>::type
+ comb_hash_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 2>::type
+ trigger_policy;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 3>::type
+ size_policy;
+
+ public:
+ typedef
+ __gnu_pbds::cc_hash_table<
+ Key,
+ Data,
+ Hash_Fn,
+ Eq_Fn,
+ comb_hash_fn,
+ __gnu_pbds::hash_standard_resize_policy<
+ size_policy,
+ trigger_policy,
+ false>,
+ store_hash,
+ Allocator>
+ type;
+ };
+
+ template<typename Policy_Tl>
+ struct access_generic_cc_hash_table_t
+ {
+ private:
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 0>::type
+ store_hash_indicator;
+
+ enum
+ {
+ store_hash = store_hash_indicator::value
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 1>::type
+ comb_hash_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 2>::type
+ trigger_policy;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 3>::type
+ size_policy;
+
+ public:
+ typedef
+ __gnu_pbds::cc_hash_table<
+ Key,
+ Data,
+ Hash_Fn,
+ Eq_Fn,
+ comb_hash_fn,
+ __gnu_pbds::hash_standard_resize_policy<
+ size_policy,
+ trigger_policy,
+ true>,
+ store_hash,
+ Allocator>
+ type;
+ };
+
+ template<typename Policy_Tl>
+ struct no_access_generic_gp_hash_table_t
+ {
+ private:
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 0>::type
+ store_hash_indicator;
+
+ enum
+ {
+ store_hash = store_hash_indicator::value
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 1>::type
+ probe_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 2>::type
+ comb_probe_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 3>::type
+ trigger_policy;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 4>::type
+ size_policy;
+
+ public:
+ typedef
+ __gnu_pbds::gp_hash_table<
+ Key,
+ Data,
+ Hash_Fn,
+ Eq_Fn,
+ comb_probe_fn,
+ probe_fn,
+ __gnu_pbds::hash_standard_resize_policy<
+ size_policy,
+ trigger_policy,
+ false>,
+ store_hash,
+ Allocator>
+ type;
+ };
+
+ template<typename Policy_Tl>
+ struct access_generic_gp_hash_table_t
+ {
+ private:
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 0>::type
+ store_hash_indicator;
+
+ enum
+ {
+ store_hash = store_hash_indicator::value
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 1>::type
+ probe_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 2>::type
+ comb_probe_fn;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 3>::type
+ trigger_policy;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ Policy_Tl, 4>::type
+ size_policy;
+
+ public:
+ typedef
+ __gnu_pbds::gp_hash_table<
+ Key,
+ Data,
+ Hash_Fn,
+ Eq_Fn,
+ comb_probe_fn,
+ probe_fn,
+ __gnu_pbds::hash_standard_resize_policy<
+ size_policy,
+ trigger_policy,
+ true>,
+ store_hash,
+ Allocator>
+ type;
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ performance_cc_range_hashing_policies,
+ no_access_generic_cc_hash_table_t>::type
+ performance_cc_types;
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ regression_cc_range_hashing_policies,
+ access_generic_cc_hash_table_t>::type
+ regression_cc_types;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ performance_cc_types,
+ 0>::type
+ performance_min_cc_type;
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ performance_gp_range_hashing_policies,
+ no_access_generic_gp_hash_table_t>::type
+ performance_gp_types;
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ regression_gp_range_hashing_policies,
+ access_generic_gp_hash_table_t>::type
+ regression_gp_types;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ performance_gp_types,
+ 0>::type
+ performance_min_gp_type;
+
+ public:
+ typedef
+ typename __gnu_cxx::typelist::append<
+ performance_cc_types,
+ performance_gp_types>::type
+ performance_tl;
+
+ typedef
+ typename __gnu_cxx::typelist::append<
+ regression_gp_types,
+ regression_cc_types>::type
+ regression_tl;
+
+ typedef
+ typename __gnu_cxx::typelist::create1<
+ performance_min_cc_type>::type
+ performance_min_tl;
+ };
+
+ template<typename Key,
+ typename Data,
+ class Comb_Hash_Fn_TL,
+ class Comb_Probe_Fn_TL,
+ class Eq_Fn =
+ std::equal_to<Key>,
+ class Allocator =
+ std::allocator<
+ std::pair<
+ const Key,
+ Data> > >
+ struct ranged_hash_common_types
+ {
+ private:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ 1, 8,
+ 1, 2,
+ false>
+ no_access_half_load_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ 1, 8,
+ 1, 1,
+ false>
+ no_access_one_load_check_resize_trigger_policy;
+
+ typedef
+ __gnu_pbds::hash_standard_resize_policy<
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator>,
+ no_access_half_load_check_resize_trigger_policy>
+ mask_half_resize_policy_t;
+
+ typedef
+ __gnu_pbds::hash_standard_resize_policy<
+ __gnu_pbds::test::hash_exponential_size_policy_t_<
+ Allocator>,
+ no_access_one_load_check_resize_trigger_policy>
+ mask_one_resize_policy_t;
+
+ typedef
+ __gnu_pbds::hash_standard_resize_policy<
+ __gnu_pbds::test::hash_prime_size_policy_t_,
+ no_access_half_load_check_resize_trigger_policy>
+ mod_half_resize_policy_t;
+
+ typedef
+ __gnu_pbds::hash_standard_resize_policy<
+ __gnu_pbds::test::hash_prime_size_policy_t_,
+ no_access_one_load_check_resize_trigger_policy>
+ mod_one_resize_policy_t;
+
+ template<typename Comb_Hash_Fn_>
+ struct half_resize_policy_selector;
+
+ template<typename Allocator_>
+ struct half_resize_policy_selector<
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator_> >
+ {
+ typedef mask_half_resize_policy_t type;
+ };
+
+ template<typename Allocator_>
+ struct half_resize_policy_selector<
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator_> >
+ {
+ typedef mod_half_resize_policy_t type;
+ };
+
+ template<typename Comb_Hash_Fn_>
+ struct one_resize_policy_selector;
+
+ template<typename Allocator_>
+ struct one_resize_policy_selector<
+ __gnu_pbds::test::direct_mask_range_hashing_t_<
+ Allocator_> >
+ {
+ typedef mask_one_resize_policy_t type;
+ };
+
+ template<typename Allocator_>
+ struct one_resize_policy_selector<
+ __gnu_pbds::test::direct_mod_range_hashing_t_<
+ Allocator_> >
+ {
+ typedef mod_one_resize_policy_t type;
+ };
+
+ template<typename Comb_Hash_Fn>
+ struct generic_cc_hash_table_t
+ {
+ typedef
+ __gnu_pbds::cc_hash_table<
+ Key,
+ Data,
+ __gnu_pbds::null_hash_fn,
+ Eq_Fn,
+ Comb_Hash_Fn,
+ typename one_resize_policy_selector<
+ typename Comb_Hash_Fn::comb_fn>::type,
+ false,
+ Allocator>
+ type;
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ Comb_Hash_Fn_TL,
+ generic_cc_hash_table_t>::type
+ performance_cc_types;
+
+ template<typename Comb_Probe_Fn>
+ struct no_access_generic_gp_hash_table_t
+ {
+ typedef
+ __gnu_pbds::gp_hash_table<
+ Key,
+ Data,
+ __gnu_pbds::null_hash_fn,
+ Eq_Fn,
+ Comb_Probe_Fn,
+ __gnu_pbds::null_probe_fn,
+ typename half_resize_policy_selector<
+ typename Comb_Probe_Fn::comb_fn>::type,
+ false,
+ Allocator>
+ type;
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ Comb_Probe_Fn_TL,
+ no_access_generic_gp_hash_table_t>::type
+ performance_gp_types;
+
+ public:
+ typedef
+ typename __gnu_cxx::typelist::append<
+ performance_cc_types,
+ performance_gp_types>::type
+ performance_tl;
+ };
+
+ template<typename Key, typename Data, class Eq_Fn = std::equal_to<Key>,
+ class Allocator =
+ std::allocator<char> >
+ class lu_common_types
+ {
+ private:
+ typedef typename Allocator::size_type size_type;
+
+ typedef __gnu_pbds::test::move_to_front_lu_policy_t_ mtf_u;
+
+ typedef __gnu_pbds::test::counter_lu_policy_t_<Allocator, 5> cnt_5_u;
+
+ typedef typename __gnu_cxx::typelist::create1<mtf_u>::type lu_policy0;
+
+ typedef typename __gnu_cxx::typelist::create1<cnt_5_u>::type lu_policy1;
+
+ typedef
+ typename __gnu_cxx::typelist::create2<lu_policy0, lu_policy1>::type
+ lu_policies;
+
+ template<typename Policy_Tl>
+ struct generic_list_update_t
+ {
+ private:
+ typedef
+ typename __gnu_cxx::typelist::at_index<Policy_Tl, 0>::type
+ update_policy_t;
+
+ public:
+ typedef
+ __gnu_pbds::list_update<Key, Data, Eq_Fn, update_policy_t, Allocator>
+ type;
+ };
+
+ typedef
+ typename __gnu_cxx::typelist::transform<
+ lu_policies,
+ generic_list_update_t>::type
+ lu_types;
+
+ typedef
+ typename __gnu_cxx::typelist::at_index<
+ lu_types,
+ 0>::type
+ min_lu_type;
+
+ public:
+ typedef lu_types performance_tl;
+ typedef lu_types regression_tl;
+
+ typedef typename __gnu_cxx::typelist::create1<min_lu_type>::type performance_min_tl;
+ };
+
+ template<typename Key, typename Data, class Cmp_Fn = std::less<Key>,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update = __gnu_pbds::null_tree_node_update,
+ class Allocator = std::allocator<std::pair<const Key, Data> > >
+ struct tree_common_types
+ {
+ private:
+ typedef
+ __gnu_pbds::tree<
+ Key,
+ Data,
+ Cmp_Fn,
+ __gnu_pbds::ov_tree_tag,
+ Node_Update,
+ Allocator>
+ ov_tree_assoc_container_t;
+
+ typedef
+ __gnu_pbds::tree<
+ Key,
+ Data,
+ Cmp_Fn,
+ __gnu_pbds::rb_tree_tag,
+ Node_Update,
+ Allocator>
+ rb_tree_assoc_container_t;
+
+ typedef
+ __gnu_pbds::tree<
+ Key,
+ Data,
+ Cmp_Fn,
+ __gnu_pbds::splay_tree_tag,
+ Node_Update,
+ Allocator>
+ splay_tree_assoc_container_t;
+
+ public:
+ typedef
+ typename __gnu_cxx::typelist::create3<
+ splay_tree_assoc_container_t,
+ rb_tree_assoc_container_t,
+ ov_tree_assoc_container_t>::type
+ performance_tl;
+
+ typedef
+ typename __gnu_cxx::typelist::create3<
+ ov_tree_assoc_container_t,
+ splay_tree_assoc_container_t,
+ rb_tree_assoc_container_t>::type
+ regression_tl;
+
+ typedef
+ typename __gnu_cxx::typelist::create1<
+ rb_tree_assoc_container_t>::type
+ performance_min_tl;
+ };
+
+ template<typename Key,
+ typename Data,
+ class E_Access_Traits =
+ typename __gnu_pbds::detail::default_trie_e_access_traits<Key>::type,
+ class Tag = __gnu_pbds::pat_trie_tag,
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ class E_Access_Traits_,
+ typename Allocator_>
+ class Node_Update = __gnu_pbds::null_trie_node_update,
+ class Allocator = std::allocator<char> >
+ class trie_common_types
+ {
+ private:
+ typedef __gnu_pbds::trie<Key, Data, E_Access_Traits, Tag, Node_Update, Allocator> type;
+
+ public:
+ typedef typename __gnu_cxx::typelist::create1<type>::type performance_tl;
+ typedef typename __gnu_cxx::typelist::create1<type>::type regression_tl;
+ typedef typename __gnu_cxx::typelist::create1<type>::type performance_min_tl;
+ };
+
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COMMON_TYPES_ASSOC_HPP
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp
new file mode 100644
index 000000000..0410ec977
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file comb_hash_fn_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+#define PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+namespace test
+{
+namespace detail
+{
+
+ template<typename Comb_Hash_Fn>
+ struct comb_hash_fn_string_form
+ {
+ static std::string
+ name()
+ { return (Comb_Hash_Fn::name()); }
+
+ static std::string
+ desc()
+ { return (Comb_Hash_Fn::desc()); }
+ };
+
+ template<typename Size_Type>
+ struct comb_hash_fn_string_form<
+ direct_mask_range_hashing_t_<
+ Size_Type> >
+ {
+ static std::string
+ name()
+ { return ("mask_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Comb_Hash_Fn", "value", "direct_mask_range_hashing");
+ }
+ };
+
+ template<typename Size_Type>
+ struct comb_hash_fn_string_form<direct_mod_range_hashing_t_<Size_Type> >
+ {
+ static std::string
+ name()
+ { return ("mod_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Comb_Hash_Fn", "value", "direct_mod_range_hashing");
+ }
+ };
+
+} // namespace detail
+} // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp
new file mode 100644
index 000000000..9ee5c4dd7
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp
@@ -0,0 +1,255 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ds_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_DS_STRING_FORM_HPP
+#define PB_DS_DS_STRING_FORM_HPP
+
+#include <string>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <common_type/assoc/detail/list_update_policy_string_form.hpp>
+#include <common_type/assoc/detail/comb_hash_fn_string_form.hpp>
+#include <common_type/assoc/detail/resize_policy_string_form.hpp>
+#include <common_type/assoc/detail/probe_fn_string_form.hpp>
+#include <common_type/assoc/detail/tree_supports_order_statistics.hpp>
+#include <common_type/assoc/detail/trie_supports_order_statistics.hpp>
+#include <common_type/assoc/detail/trie_supports_prefix_search.hpp>
+#include <common_type/assoc/detail/store_hash_string_form.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ namespace detail
+ {
+ template<typename Cntnr, class Tag>
+ struct ds_string_form;
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::cc_hash_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("cc_hash_" +
+ comb_hash_fn_string_form<typename Cntnr::comb_hash_fn>::name() +
+ resize_policy_string_form<typename Cntnr::resize_policy>::name() +
+ store_hash_string_form<Cntnr::store_hash>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string comb_hash_fn_desc =
+ comb_hash_fn_string_form<typename Cntnr::comb_hash_fn>::desc();
+
+ const std::string resize_policy_desc =
+ resize_policy_string_form<typename Cntnr::resize_policy>::desc();
+
+ const std::string store_hash_desc =
+ store_hash_string_form<Cntnr::store_hash>::desc();
+
+ return (make_xml_tag("type", "value", "cc_hash_table", comb_hash_fn_desc + resize_policy_desc + store_hash_desc));
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::gp_hash_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("gp_hash_" +
+ comb_hash_fn_string_form<typename Cntnr::comb_probe_fn>::name() +
+ probe_fn_string_form<typename Cntnr::probe_fn>::name() +
+ resize_policy_string_form<typename Cntnr::resize_policy>::name() +
+ store_hash_string_form<Cntnr::store_hash>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string comb_probe_fn_desc =
+ comb_hash_fn_string_form<typename Cntnr::comb_probe_fn>::desc();
+
+ const std::string probe_fn_desc =
+ probe_fn_string_form<typename Cntnr::probe_fn>::desc();
+
+ const std::string resize_policy_desc =
+ resize_policy_string_form<typename Cntnr::resize_policy>::desc();
+
+ const std::string store_hash_desc =
+ store_hash_string_form<Cntnr::store_hash>::desc();
+
+ return make_xml_tag("type", "value", "gp_hash_table",
+ comb_probe_fn_desc + probe_fn_desc + resize_policy_desc + store_hash_desc);
+ }
+ };
+
+ template<typename Cntnr>
+ struct tree_ds_string_form
+ {
+ static std::string
+ name(const std::string container_category_str)
+ {
+ if (tree_supports_order_statistics<Cntnr>::value)
+ return (container_category_str + "ost_");
+ return container_category_str;
+ }
+
+ static std::string
+ desc(const std::string container_category_str)
+ {
+ const std::string category_str =
+ make_xml_tag("Tag", "value", container_category_str);
+
+ const std::string node_update_str =
+ make_xml_tag("Node_Update",
+ "value",(tree_supports_order_statistics<Cntnr>::value ?
+ "tree_order_statistics_node_update" : "null_tree_node_update"));
+
+ return make_xml_tag("type", "value", "tree", category_str + node_update_str);
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::rb_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return base_type::name("rb_tree_"); }
+
+ static std::string
+ desc()
+ { return base_type::desc("rb_tree_tag"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::splay_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return base_type::name("splay_tree_"); }
+
+ static std::string
+ desc()
+ { return base_type::desc("splay_tree_tag"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::ov_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return (base_type::name("ov_tree_")); }
+
+ static std::string
+ desc()
+ { return (base_type::desc("ov_tree_tag")); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::list_update_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("lu_" +
+ lu_policy_string_form<typename Cntnr::update_policy>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("type", "value", "list_update",
+ lu_policy_string_form<typename Cntnr::update_policy>::desc());
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::pat_trie_tag>
+ {
+ static std::string
+ name()
+ {
+ if (trie_supports_order_statistics<Cntnr>::value)
+ return ("pat_trie_ost_");
+
+ if (trie_supports_prefix_search<Cntnr>::value)
+ return ("pat_trie_prs_");
+
+ return ("pat_trie_");
+ }
+
+ static std::string
+ desc()
+ {
+ std::string category_s = make_xml_tag("Tag", "value", "pat_trie_tag");
+ const char* s;
+ if (trie_supports_order_statistics<Cntnr>::value)
+ s = "trie_order_statistics_node_update";
+ else if (trie_supports_prefix_search<Cntnr>::value)
+ s = "trie_prefix_search_node_update";
+ else
+ s = "null_trie_node_update";
+ std::string node_s = make_xml_tag("Node_Update", "value", s);
+ return make_xml_tag("type", "value", "trie", category_s + node_s);
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_DS_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp
new file mode 100644
index 000000000..ed3747fa1
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file lu_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_LU_POLICY_STRING_FORM_HPP
+#define PB_DS_LU_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Update_Policy>
+ struct lu_policy_string_form;
+
+ template<>
+ struct lu_policy_string_form<move_to_front_lu_policy_t_>
+ {
+ static std::string
+ name()
+ { return ("mtf_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Update_Policy", "value",
+ "move_to_front_lu_policy");
+ }
+ };
+
+ template<typename Allocator, typename Allocator::size_type Max_Count>
+ struct lu_policy_string_form<counter_lu_policy_t_<Allocator, Max_Count> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+ ret << "cnt_" << Max_Count << "_";
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Update_Policy", "value", "counter_lu_policy",
+ "Max_Count", Max_Count));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LU_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp
new file mode 100644
index 000000000..15cbbfda5
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file probe_fn_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_PROBE_FN_STRING_FORM_HPP
+#define PB_DS_PROBE_FN_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Probe_Fn>
+ struct probe_fn_string_form;
+
+ template<typename Key, class Allocator>
+ struct probe_fn_string_form<linear_probe_fn_t_<Key, Allocator> >
+ {
+ static std::string
+ name()
+ { return ("linp_"); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "linear_probe_fn"); }
+ };
+
+ template<typename Key, class Allocator>
+ struct probe_fn_string_form<quadratic_probe_fn_t_<Key, Allocator> >
+ {
+ static std::string
+ name()
+ { return ("quadp_"); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "quadratic_probe_fn"); }
+ };
+
+ template<>
+ struct probe_fn_string_form<__gnu_pbds::null_probe_fn>
+ {
+ static std::string
+ name()
+ { return (""); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "null_probe_fn"); }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PROBE_FN_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp
new file mode 100644
index 000000000..8d5b68698
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+#define PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/detail/size_policy_string_form.hpp>
+#include <common_type/assoc/detail/trigger_policy_string_form.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Resize_Policy>
+ struct resize_policy_string_form;
+
+ template<typename Size_Policy,
+ class Trigger_Policy,
+ bool External_Size_Access,
+ typename Size_Type>
+ struct resize_policy_string_form<
+ __gnu_pbds::hash_standard_resize_policy<
+ Size_Policy, Trigger_Policy, External_Size_Access, Size_Type> >
+ {
+ static std::string
+ name()
+ {
+ return (size_policy_string_form<Size_Policy>::name() +
+ trigger_policy_string_form<Trigger_Policy>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string size_policy_string_form_desc =
+ size_policy_string_form<Size_Policy>::desc();
+
+ const std::string trigger_policy_string_form_desc =
+ trigger_policy_string_form<Trigger_Policy>::desc();
+
+ return (make_xml_tag("Resize_Policy", "value", "hash_standard_resize_policy", size_policy_string_form_desc + trigger_policy_string_form_desc));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp
new file mode 100644
index 000000000..d2b61facb
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file size_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_SIZE_POLICY_STRING_FORM_HPP
+#define PB_DS_SIZE_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/detail/size_policy_string_form.hpp>
+#include <common_type/assoc/detail/trigger_policy_string_form.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Size_Policy>
+ struct size_policy_string_form;
+
+ template<typename Allocator>
+ struct size_policy_string_form<
+ __gnu_pbds::test::hash_exponential_size_policy_t_<Allocator> >
+ {
+ static std::string
+ name()
+ { return ("exp_"); }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Size_Policy", "value", "hash_exponential_size_policy"));
+ }
+ };
+
+ template<>
+ struct size_policy_string_form<
+ __gnu_pbds::test::hash_prime_size_policy_t_>
+ {
+ static std::string
+ name()
+ { return ("prime_"); }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Size_Policy", "value", "hash_prime_size_policy"));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_SIZE_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp
new file mode 100644
index 000000000..a932948fa
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file store_hash_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_STORE_HASH_STRING_FORM_HPP
+#define PB_DS_STORE_HASH_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<bool Store_Hash>
+ struct store_hash_string_form
+ {
+ static std::string
+ name()
+ { return ("sth_"); }
+
+ static std::string
+ desc()
+ { return (make_xml_tag("Store_Hash", "value", "true")); }
+ };
+
+ template<>
+ struct store_hash_string_form<false>
+ {
+ static std::string
+ name()
+ { return ("nsth_"); }
+
+ static std::string
+ desc()
+ { return (make_xml_tag("Store_Hash", "value", "false")); }
+ };
+
+ } // namespace detail
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_STORE_HASH_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp
new file mode 100644
index 000000000..80c1abe54
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_supports_order_statistics.hpp
+ * Checks whether a tree supports order statistics.
+ */
+
+#ifndef PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+#define PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+
+#include <ext/pb_ds/tree_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct tree_supports_order_statistics
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::tree_order_statistics_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::cmp_fn,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp
new file mode 100644
index 000000000..fc9cacc63
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_supports_order_statistics.hpp
+ * Checks whether a trie supports order stats.
+ */
+
+#ifndef PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+#define PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+
+#include <ext/pb_ds/trie_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct trie_supports_order_statistics
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::trie_order_statistics_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::e_access_traits,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp
new file mode 100644
index 000000000..20c521010
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_supports_prefix_search.hpp
+ * Checks whether a trie supports prefix search.
+ */
+
+#ifndef PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+#define PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+
+#include <ext/pb_ds/trie_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct trie_supports_prefix_search
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::trie_prefix_search_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::e_access_traits,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp
new file mode 100644
index 000000000..be4fe264f
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trigger_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+#define PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Trigger_Policy>
+ struct trigger_policy_string_form;
+
+ template<typename Allocator,
+ typename Allocator::size_type Min_Load_Nom,
+ typename Allocator::size_type Min_Load_Denom,
+ typename Allocator::size_type Max_Load_Nom,
+ typename Allocator::size_type Max_Load_Denom,
+ bool External_Access>
+ struct trigger_policy_string_form<
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ Min_Load_Nom,
+ Min_Load_Denom,
+ Max_Load_Nom,
+ Max_Load_Denom,
+ External_Access> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+
+ ret << (External_Access? "": "n") << "ea_"
+ "lc_" << Min_Load_Nom << "div" << Min_Load_Denom << "_" <<
+ Max_Load_Nom << "div" << Max_Load_Denom << "_";
+
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string ext_access_desc =
+ make_xml_tag("External_Access",
+ "value",(External_Access? "true" : "false"));
+
+ const std::string loads_desc =
+ make_xml_tag("alpha_min", "nom", Min_Load_Nom, "denom", Min_Load_Denom) +
+ make_xml_tag("alpha_max", "nom", Max_Load_Nom, "denom", Max_Load_Denom);
+
+ return (make_xml_tag("Trigger_Policy", "value", "hash_load_check_resize_trigger", ext_access_desc + loads_desc));
+ }
+ };
+
+ template<typename Allocator,
+ typename Allocator::size_type Load_Nom,
+ typename Allocator::size_type Load_Denom,
+ bool External_Access>
+ struct trigger_policy_string_form<
+ __gnu_pbds::test::cc_hash_max_collision_check_resize_trigger_t_<
+ Allocator,
+ Load_Nom,
+ Load_Denom,
+ External_Access> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+
+ ret << (External_Access? "": "n") << "ea_"
+ "mcolc_" << Load_Nom << "div" << Load_Denom << "_";
+
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string ext_access_desc =
+ make_xml_tag("External_Access",
+ "value",(External_Access? "true" : "false"));
+
+ const std::string load_desc =
+ make_xml_tag("alpha", "nom", Load_Nom, "denom", Load_Denom);
+
+ return (make_xml_tag("Trigger_Policy", "value", "cc_hash_max_collision_check_resize_trigger", ext_access_desc + load_desc));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/native_set.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/native_set.hpp
new file mode 100644
index 000000000..a2655fe75
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/native_set.hpp
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file native_set.hpp
+ * Contains an adapter to Dinkumware/SGI tree tables
+ */
+
+#ifndef PB_DS_NATIVE_SET_HPP
+#define PB_DS_NATIVE_SET_HPP
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <native_type/native_tree_tag.hpp>
+#include <io/xml.hpp>
+#include <string>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ template<typename Key, class Cmp_Fn = std::less<Key>,
+ class Allocator = std::allocator<char> >
+ class native_set : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef std::set<Key, Cmp_Fn, typename Allocator::template rebind<Key>::other> base_type;
+
+ public:
+ typedef native_tree_tag container_category;
+
+ typedef typename base_type::const_iterator const_iterator;
+
+ public:
+ native_set() : base_type()
+ { }
+
+ template<typename It>
+ native_set(It f, It l) : base_type(f, l)
+ { }
+
+ native_set(const_iterator f, const_iterator l) : base_type(f, l)
+ { }
+
+ static std::string
+ name()
+ { return ("n_set"); }
+
+ static std::string
+ desc()
+ { return (make_xml_tag("type", "value", "std_set")); }
+ };
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/string_form.hpp
new file mode 100644
index 000000000..d7825ac63
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/string_form.hpp
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_STRING_FORM_HPP
+#define PB_DS_STRING_FORM_HPP
+
+#include <string>
+#include <sstream>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <native_type/native_hash_map.hpp>
+#include <native_type/native_hash_set.hpp>
+#include <native_type/native_multimap.hpp>
+#include <native_type/native_hash_multimap.hpp>
+#include <native_type/native_set.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <common_type/assoc/detail/ds_string_form.hpp>
+#include <regression/basic_type.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ namespace detail
+ {
+ template<typename Cntnr>
+ struct pb_ds_string_form
+ {
+ private:
+ typedef typename Cntnr::mapped_type mapped_type;
+
+ struct mapped_string_form
+ {
+ private:
+ template<typename D_Cntnr>
+ static std::string
+ name(D_Cntnr)
+ { return ("mmap_" + pb_ds_string_form<D_Cntnr>::name()); }
+
+ template<typename D_Cntnr>
+ static std::string
+ desc(D_Cntnr)
+ { return pb_ds_string_form<D_Cntnr>::desc(); }
+
+ static std::string
+ name(size_t)
+ { return ("map"); }
+
+ static std::string
+ desc(size_t)
+ { return (""); }
+
+ static std::string
+ name(basic_type)
+ { return ("map"); }
+
+ static std::string
+ desc(basic_type)
+ { return (""); }
+
+ static std::string
+ name(int)
+ { return ("map"); }
+
+ static std::string
+ desc(int)
+ { return (""); }
+
+ static std::string
+ name(char)
+ { return ("map"); }
+
+ static std::string
+ desc(char)
+ { return (""); }
+
+ static std::string
+ name(__gnu_pbds::null_mapped_type)
+ { return ("set"); }
+
+ static std::string
+ desc(__gnu_pbds::null_mapped_type)
+ { return (""); }
+
+ public:
+ static std::string
+ name()
+ { return name(mapped_type()); }
+
+ static std::string
+ desc()
+ { return desc(mapped_type()); }
+ };
+
+ typedef
+ detail::ds_string_form<Cntnr, typename Cntnr::container_category>
+ ds_string_form_t;
+
+ public:
+ static std::string
+ name()
+ { return (ds_string_form_t::name() + mapped_string_form::name()); }
+
+ static std::string
+ desc()
+ { return (ds_string_form_t::desc() + mapped_string_form::desc()); }
+ };
+
+ template<typename Cntnr>
+ struct native_string_form
+ {
+ static std::string
+ name()
+ { return Cntnr::name(); }
+
+ static std::string
+ desc()
+ { return Cntnr::desc(); }
+ };
+
+ template<typename Cntnr, class Tag>
+ struct tag_select_string_form : public pb_ds_string_form<Cntnr>
+ { };
+
+ template<typename Cntnr>
+ struct tag_select_string_form<Cntnr, native_hash_tag>
+ : public native_string_form<Cntnr>
+ { };
+
+ template<typename Cntnr>
+ struct tag_select_string_form<Cntnr, native_tree_tag>
+ : public native_string_form<Cntnr>
+ { };
+ } // namespace detail
+
+ template<typename Cntnr>
+ struct string_form
+ : public detail::tag_select_string_form<Cntnr,
+ typename Cntnr::container_category>
+ { };
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/template_policy.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/template_policy.hpp
new file mode 100644
index 000000000..86db029e2
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/template_policy.hpp
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file template_policy.hpp
+ * Contains template versions of policies.
+ */
+
+#ifndef PB_DS_TEMPLATE_POLICY_HPP
+#define PB_DS_TEMPLATE_POLICY_HPP
+
+#include <ext/typelist.h>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ template<typename Allocator>
+ struct direct_mask_range_hashing_t_
+ : public __gnu_pbds::direct_mask_range_hashing<typename Allocator::size_type>
+ {
+ typedef typename Allocator::size_type size_type;
+ typedef __gnu_pbds::direct_mask_range_hashing<size_type> base_type;
+ };
+
+ template<typename Allocator>
+ struct direct_mod_range_hashing_t_
+ : public __gnu_pbds::direct_mod_range_hashing<typename Allocator::size_type>
+ {
+ typedef typename Allocator::size_type size_type;
+ typedef __gnu_pbds::direct_mod_range_hashing<size_type> base_type;
+ };
+
+ template<typename Allocator,
+ typename Allocator::size_type Min_Load_Nom,
+ typename Allocator::size_type Min_Load_Denom,
+ typename Allocator::size_type Max_Load_Nom,
+ typename Allocator::size_type Max_Load_Denom,
+ bool External_Access>
+ struct hash_load_check_resize_trigger_t_
+ : public __gnu_pbds::hash_load_check_resize_trigger<External_Access,
+ typename Allocator::size_type>
+ {
+ typedef typename Allocator::size_type size_type;
+ typedef __gnu_pbds::hash_load_check_resize_trigger<External_Access, size_type> base_type;
+
+ inline
+ hash_load_check_resize_trigger_t_()
+ : base_type(static_cast<float>(Min_Load_Nom) / static_cast<float>(Min_Load_Denom), static_cast<float>(Max_Load_Nom) / static_cast<float>(Max_Load_Denom))
+ { }
+
+ enum
+ {
+ get_set_loads = External_Access,
+ get_set_load = false
+ };
+ };
+
+ template<typename Allocator,
+ typename Allocator::size_type Load_Nom,
+ typename Allocator::size_type Load_Denom,
+ bool External_Access>
+ struct cc_hash_max_collision_check_resize_trigger_t_
+ : public __gnu_pbds::cc_hash_max_collision_check_resize_trigger<External_Access,
+ typename Allocator::size_type>
+ {
+ typedef typename Allocator::size_type size_type;
+ typedef __gnu_pbds::cc_hash_max_collision_check_resize_trigger<External_Access, size_type> base_type;
+
+ inline
+ cc_hash_max_collision_check_resize_trigger_t_()
+ : base_type(static_cast<float>(Load_Nom) / static_cast<float>(Load_Denom))
+ { }
+
+ enum
+ {
+ get_set_load = External_Access,
+ get_set_loads = false
+ };
+ };
+
+ struct hash_prime_size_policy_t_ : public __gnu_pbds::hash_prime_size_policy
+ { };
+
+ template<typename Allocator>
+ struct hash_exponential_size_policy_t_
+ : public __gnu_pbds::hash_exponential_size_policy<typename Allocator::size_type>
+ { };
+
+ template<typename Key, class Allocator>
+ struct linear_probe_fn_t_
+ : public __gnu_pbds::linear_probe_fn<typename Allocator::size_type>
+ { };
+
+ template<typename Key, class Allocator>
+ struct quadratic_probe_fn_t_
+ : public __gnu_pbds::quadratic_probe_fn<typename Allocator::size_type>
+ { };
+
+ template<typename Allocator, typename Allocator::size_type Max_Count>
+ struct counter_lu_policy_t_
+ : public __gnu_pbds::counter_lu_policy<Max_Count, Allocator>
+ {
+ typedef __gnu_pbds::counter_lu_policy<Max_Count, Allocator> base_type;
+ };
+
+ struct move_to_front_lu_policy_t_
+ : public __gnu_pbds::move_to_front_lu_policy<>
+ { };
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/libstdc++-v3/testsuite/util/common_type/priority_queue/common_type.hpp b/libstdc++-v3/testsuite/util/common_type/priority_queue/common_type.hpp
new file mode 100644
index 000000000..cc79b3eec
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/priority_queue/common_type.hpp
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file common_type.hpp
+ * Contains common types.
+ */
+
+#ifndef PB_DS_COMMON_TYPES_PQ_HPP
+#define PB_DS_COMMON_TYPES_PQ_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/priority_queue.hpp>
+#include <ext/typelist.h>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ template<typename Value_Type, typename Cmp_Fn = std::less<Value_Type>,
+ class Allocator = std::allocator<Value_Type> >
+ struct pq_common_types
+ {
+ private:
+ typedef __gnu_pbds::priority_queue<Value_Type, Cmp_Fn, __gnu_pbds::pairing_heap_tag, Allocator> pairing_heap_t;
+
+ typedef __gnu_pbds::priority_queue<Value_Type, Cmp_Fn, __gnu_pbds::binomial_heap_tag, Allocator> binomial_heap_t;
+
+ typedef __gnu_pbds::priority_queue<Value_Type, Cmp_Fn, __gnu_pbds::rc_binomial_heap_tag, Allocator> rc_binomial_heap_t;
+
+ typedef __gnu_pbds::priority_queue<Value_Type, Cmp_Fn, __gnu_pbds::binary_heap_tag, Allocator> binary_heap_t;
+
+ typedef __gnu_pbds::priority_queue<Value_Type, Cmp_Fn, __gnu_pbds::thin_heap_tag, Allocator> thin_heap_t;
+
+ typedef typename __gnu_cxx::typelist::create5<thin_heap_t, pairing_heap_t, binomial_heap_t, rc_binomial_heap_t, binary_heap_t>::type all_tl;
+
+ public:
+ typedef all_tl performance_tl;
+ typedef all_tl regression_tl;
+ typedef all_tl performance_min_tl;
+ typedef all_tl regression_min_tl;
+ };
+
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COMMON_TYPES_PQ_HPP
diff --git a/libstdc++-v3/testsuite/util/common_type/priority_queue/detail/ds_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/priority_queue/detail/ds_string_form.hpp
new file mode 100644
index 000000000..8194356b7
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/priority_queue/detail/ds_string_form.hpp
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ds_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_DS_STRING_FORM_HPP
+#define PB_DS_DS_STRING_FORM_HPP
+
+#include <string>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ namespace detail
+ {
+ template<typename Cntnr, class Tag>
+ struct ds_string_form;
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::pairing_heap_tag>
+ {
+ static std::string
+ name()
+ { return "pairing_heap"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "pairing_heap"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::thin_heap_tag>
+ {
+ static std::string
+ name()
+ { return "thin_heap"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "thin_heap"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::binomial_heap_tag>
+ {
+ static std::string
+ name()
+ { return "binomial_heap"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "binomial_heap"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::rc_binomial_heap_tag>
+ {
+ static std::string
+ name()
+ { return "rc_binomial_heap"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "rc_binomial_heap"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::binary_heap_tag>
+ {
+ static std::string
+ name()
+ { return "binary_heap"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "binary_heap"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::sequence_tag>
+ {
+ static std::string
+ name()
+ { return "sequence"; }
+
+ static std::string
+ desc()
+ { return make_xml_tag("type", "value", "sequence"); }
+ };
+
+ } // namespace detail
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_DS_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/priority_queue/string_form.hpp b/libstdc++-v3/testsuite/util/common_type/priority_queue/string_form.hpp
new file mode 100644
index 000000000..e3e13f87d
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/priority_queue/string_form.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 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
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_STRING_FORM_HPP
+#define PB_DS_STRING_FORM_HPP
+
+#include <string>
+#include <sstream>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <native_type/native_priority_queue.hpp>
+#include <common_type/priority_queue/detail/ds_string_form.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ namespace detail
+ {
+ template<typename Cntnr>
+ struct pb_ds_string_form
+ {
+ private:
+ typedef ds_string_form<Cntnr, typename Cntnr::container_category> ds_string_form_t;
+
+ public:
+ static std::string
+ name()
+ { return ds_string_form_t::name(); }
+
+ static std::string
+ desc()
+ { return ds_string_form_t::desc(); }
+ };
+
+ template<typename Cntnr>
+ struct native_string_form
+ {
+ static std::string
+ name()
+ { return Cntnr::name(); }
+
+ static std::string
+ desc()
+ { return Cntnr::desc(); }
+ };
+
+ template<typename Cntnr, class Tag>
+ struct tag_select_string_form : public pb_ds_string_form<Cntnr>
+ { };
+
+ template<typename Cntnr>
+ struct tag_select_string_form<Cntnr, native_pq_tag>
+ : public native_string_form<Cntnr>
+ { };
+ } // namespace detail
+
+ template<typename Cntnr>
+ struct string_form
+ : public detail::tag_select_string_form<Cntnr, typename Cntnr::container_category>
+ { };
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_STRING_FORM_HPP
+