From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; 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. --- .../util/common_type/assoc/common_type.hpp | 799 +++++++++++++++++++++ .../assoc/detail/comb_hash_fn_string_form.hpp | 98 +++ .../common_type/assoc/detail/ds_string_form.hpp | 255 +++++++ .../detail/list_update_policy_string_form.hpp | 97 +++ .../assoc/detail/probe_fn_string_form.hpp | 99 +++ .../assoc/detail/resize_policy_string_form.hpp | 93 +++ .../assoc/detail/size_policy_string_form.hpp | 95 +++ .../assoc/detail/store_hash_string_form.hpp | 82 +++ .../detail/tree_supports_order_statistics.hpp | 73 ++ .../detail/trie_supports_order_statistics.hpp | 73 ++ .../assoc/detail/trie_supports_prefix_search.hpp | 73 ++ .../assoc/detail/trigger_policy_string_form.hpp | 141 ++++ .../util/common_type/assoc/native_set.hpp | 84 +++ .../util/common_type/assoc/string_form.hpp | 179 +++++ .../util/common_type/assoc/template_policy.hpp | 145 ++++ .../common_type/priority_queue/common_type.hpp | 75 ++ .../priority_queue/detail/ds_string_form.hpp | 130 ++++ .../common_type/priority_queue/string_form.hpp | 99 +++ 18 files changed, 2690 insertions(+) create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/common_type.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/native_set.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/assoc/template_policy.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/priority_queue/common_type.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/priority_queue/detail/ds_string_form.hpp create mode 100644 libstdc++-v3/testsuite/util/common_type/priority_queue/string_form.hpp (limited to 'libstdc++-v3/testsuite/util/common_type') 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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + template::type, + class Eq_Fn = std::equal_to, + class Allocator = std::allocator > > + 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_ lin_p_t; + + typedef __gnu_pbds::test::quadratic_probe_fn_t_ 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 + 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 + 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 + 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 + 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, + 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 + struct half_resize_policy_selector; + + template + struct half_resize_policy_selector< + __gnu_pbds::test::direct_mask_range_hashing_t_< + Allocator_> > + { + typedef mask_half_resize_policy_t type; + }; + + template + struct half_resize_policy_selector< + __gnu_pbds::test::direct_mod_range_hashing_t_< + Allocator_> > + { + typedef mod_half_resize_policy_t type; + }; + + template + struct one_resize_policy_selector; + + template + struct one_resize_policy_selector< + __gnu_pbds::test::direct_mask_range_hashing_t_< + Allocator_> > + { + typedef mask_one_resize_policy_t type; + }; + + template + struct one_resize_policy_selector< + __gnu_pbds::test::direct_mod_range_hashing_t_< + Allocator_> > + { + typedef mod_one_resize_policy_t type; + }; + + template + 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 + 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, + class Allocator = + std::allocator > + 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_ cnt_5_u; + + typedef typename __gnu_cxx::typelist::create1::type lu_policy0; + + typedef typename __gnu_cxx::typelist::create1::type lu_policy1; + + typedef + typename __gnu_cxx::typelist::create2::type + lu_policies; + + template + struct generic_list_update_t + { + private: + typedef + typename __gnu_cxx::typelist::at_index::type + update_policy_t; + + public: + typedef + __gnu_pbds::list_update + 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::type performance_min_tl; + }; + + template, + template + class Node_Update = __gnu_pbds::null_tree_node_update, + class Allocator = std::allocator > > + 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::type, + class Tag = __gnu_pbds::pat_trie_tag, + template + class Node_Update = __gnu_pbds::null_trie_node_update, + class Allocator = std::allocator > + class trie_common_types + { + private: + typedef __gnu_pbds::trie type; + + public: + typedef typename __gnu_cxx::typelist::create1::type performance_tl; + typedef typename __gnu_cxx::typelist::create1::type regression_tl; + typedef typename __gnu_cxx::typelist::create1::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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ +namespace test +{ +namespace detail +{ + + template + 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 + 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 + struct comb_hash_fn_string_form > + { + 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 +// . + + +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + namespace detail + { + template + struct ds_string_form; + + template + struct ds_string_form + { + static std::string + name() + { + return ("cc_hash_" + + comb_hash_fn_string_form::name() + + resize_policy_string_form::name() + + store_hash_string_form::name()); + } + + static std::string + desc() + { + const std::string comb_hash_fn_desc = + comb_hash_fn_string_form::desc(); + + const std::string resize_policy_desc = + resize_policy_string_form::desc(); + + const std::string store_hash_desc = + store_hash_string_form::desc(); + + return (make_xml_tag("type", "value", "cc_hash_table", comb_hash_fn_desc + resize_policy_desc + store_hash_desc)); + } + }; + + template + struct ds_string_form + { + static std::string + name() + { + return ("gp_hash_" + + comb_hash_fn_string_form::name() + + probe_fn_string_form::name() + + resize_policy_string_form::name() + + store_hash_string_form::name()); + } + + static std::string + desc() + { + const std::string comb_probe_fn_desc = + comb_hash_fn_string_form::desc(); + + const std::string probe_fn_desc = + probe_fn_string_form::desc(); + + const std::string resize_policy_desc = + resize_policy_string_form::desc(); + + const std::string store_hash_desc = + store_hash_string_form::desc(); + + return make_xml_tag("type", "value", "gp_hash_table", + comb_probe_fn_desc + probe_fn_desc + resize_policy_desc + store_hash_desc); + } + }; + + template + struct tree_ds_string_form + { + static std::string + name(const std::string container_category_str) + { + if (tree_supports_order_statistics::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::value ? + "tree_order_statistics_node_update" : "null_tree_node_update")); + + return make_xml_tag("type", "value", "tree", category_str + node_update_str); + } + }; + + template + struct ds_string_form + : private tree_ds_string_form + { + 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 + struct ds_string_form + : private tree_ds_string_form + { + 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 + struct ds_string_form + : private tree_ds_string_form + { + 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 + struct ds_string_form + { + static std::string + name() + { + return ("lu_" + + lu_policy_string_form::name()); + } + + static std::string + desc() + { + return make_xml_tag("type", "value", "list_update", + lu_policy_string_form::desc()); + } + }; + + template + struct ds_string_form + { + static std::string + name() + { + if (trie_supports_order_statistics::value) + return ("pat_trie_ost_"); + + if (trie_supports_prefix_search::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::value) + s = "trie_order_statistics_node_update"; + else if (trie_supports_prefix_search::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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + struct lu_policy_string_form; + + template<> + struct lu_policy_string_form + { + static std::string + name() + { return ("mtf_"); } + + static std::string + desc() + { + return make_xml_tag("Update_Policy", "value", + "move_to_front_lu_policy"); + } + }; + + template + struct lu_policy_string_form > + { + 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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + struct probe_fn_string_form; + + template + struct probe_fn_string_form > + { + static std::string + name() + { return ("linp_"); } + + static std::string + desc() + { return make_xml_tag("Probe_Fn", "value", "linear_probe_fn"); } + }; + + template + struct probe_fn_string_form > + { + 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 +// . + + +// 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 +#include +#include +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + struct resize_policy_string_form; + + template + 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::name() + + trigger_policy_string_form::name()); + } + + static std::string + desc() + { + const std::string size_policy_string_form_desc = + size_policy_string_form::desc(); + + const std::string trigger_policy_string_form_desc = + trigger_policy_string_form::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 +// . + + +// 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 +#include +#include +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + struct size_policy_string_form; + + template + struct size_policy_string_form< + __gnu_pbds::test::hash_exponential_size_policy_t_ > + { + 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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + 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 + { + 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 +// . + + +// 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 + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + 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 +// . + + +// 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 + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + 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 +// . + + +// 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 + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + 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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + + namespace test + { + + namespace detail + { + + template + struct trigger_policy_string_form; + + template + 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 + 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 +// . + + +// 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 +#include +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + template, + class Allocator = std::allocator > + class native_set : public PB_DS_BASE_C_DEC + { + private: + typedef std::set::other> base_type; + + public: + typedef native_tree_tag container_category; + + typedef typename base_type::const_iterator const_iterator; + + public: + native_set() : base_type() + { } + + template + 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 +// . + + +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + namespace detail + { + template + struct pb_ds_string_form + { + private: + typedef typename Cntnr::mapped_type mapped_type; + + struct mapped_string_form + { + private: + template + static std::string + name(D_Cntnr) + { return ("mmap_" + pb_ds_string_form::name()); } + + template + static std::string + desc(D_Cntnr) + { return pb_ds_string_form::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 + 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 + struct native_string_form + { + static std::string + name() + { return Cntnr::name(); } + + static std::string + desc() + { return Cntnr::desc(); } + }; + + template + struct tag_select_string_form : public pb_ds_string_form + { }; + + template + struct tag_select_string_form + : public native_string_form + { }; + + template + struct tag_select_string_form + : public native_string_form + { }; + } // namespace detail + + template + struct string_form + : public detail::tag_select_string_form + { }; + } // 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 +// . + + +// 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 +#include +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + template + struct direct_mask_range_hashing_t_ + : public __gnu_pbds::direct_mask_range_hashing + { + typedef typename Allocator::size_type size_type; + typedef __gnu_pbds::direct_mask_range_hashing base_type; + }; + + template + struct direct_mod_range_hashing_t_ + : public __gnu_pbds::direct_mod_range_hashing + { + typedef typename Allocator::size_type size_type; + typedef __gnu_pbds::direct_mod_range_hashing base_type; + }; + + template + struct hash_load_check_resize_trigger_t_ + : public __gnu_pbds::hash_load_check_resize_trigger + { + typedef typename Allocator::size_type size_type; + typedef __gnu_pbds::hash_load_check_resize_trigger base_type; + + inline + hash_load_check_resize_trigger_t_() + : base_type(static_cast(Min_Load_Nom) / static_cast(Min_Load_Denom), static_cast(Max_Load_Nom) / static_cast(Max_Load_Denom)) + { } + + enum + { + get_set_loads = External_Access, + get_set_load = false + }; + }; + + template + struct cc_hash_max_collision_check_resize_trigger_t_ + : public __gnu_pbds::cc_hash_max_collision_check_resize_trigger + { + typedef typename Allocator::size_type size_type; + typedef __gnu_pbds::cc_hash_max_collision_check_resize_trigger base_type; + + inline + cc_hash_max_collision_check_resize_trigger_t_() + : base_type(static_cast(Load_Nom) / static_cast(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 + struct hash_exponential_size_policy_t_ + : public __gnu_pbds::hash_exponential_size_policy + { }; + + template + struct linear_probe_fn_t_ + : public __gnu_pbds::linear_probe_fn + { }; + + template + struct quadratic_probe_fn_t_ + : public __gnu_pbds::quadratic_probe_fn + { }; + + template + struct counter_lu_policy_t_ + : public __gnu_pbds::counter_lu_policy + { + typedef __gnu_pbds::counter_lu_policy 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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + template, + class Allocator = std::allocator > + struct pq_common_types + { + private: + typedef __gnu_pbds::priority_queue pairing_heap_t; + + typedef __gnu_pbds::priority_queue binomial_heap_t; + + typedef __gnu_pbds::priority_queue rc_binomial_heap_t; + + typedef __gnu_pbds::priority_queue binary_heap_t; + + typedef __gnu_pbds::priority_queue thin_heap_t; + + typedef typename __gnu_cxx::typelist::create5::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 +// . + + +// 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 +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + namespace detail + { + template + struct ds_string_form; + + template + struct ds_string_form + { + static std::string + name() + { return "pairing_heap"; } + + static std::string + desc() + { return make_xml_tag("type", "value", "pairing_heap"); } + }; + + template + struct ds_string_form + { + static std::string + name() + { return "thin_heap"; } + + static std::string + desc() + { return make_xml_tag("type", "value", "thin_heap"); } + }; + + template + struct ds_string_form + { + static std::string + name() + { return "binomial_heap"; } + + static std::string + desc() + { return make_xml_tag("type", "value", "binomial_heap"); } + }; + + template + struct ds_string_form + { + static std::string + name() + { return "rc_binomial_heap"; } + + static std::string + desc() + { return make_xml_tag("type", "value", "rc_binomial_heap"); } + }; + + template + struct ds_string_form + { + static std::string + name() + { return "binary_heap"; } + + static std::string + desc() + { return make_xml_tag("type", "value", "binary_heap"); } + }; + + template + struct ds_string_form + { + 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 +// . + + +// 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 +#include +#include +#include +#include +#include + +namespace __gnu_pbds +{ + namespace test + { + namespace detail + { + template + struct pb_ds_string_form + { + private: + typedef ds_string_form 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 + struct native_string_form + { + static std::string + name() + { return Cntnr::name(); } + + static std::string + desc() + { return Cntnr::desc(); } + }; + + template + struct tag_select_string_form : public pb_ds_string_form + { }; + + template + struct tag_select_string_form + : public native_string_form + { }; + } // namespace detail + + template + struct string_form + : public detail::tag_select_string_form + { }; + } // namespace test +} // namespace __gnu_pbds + +#endif // #ifndef PB_DS_STRING_FORM_HPP + -- cgit v1.2.3