Commit d7f245b1 by Benjamin Kosnik Committed by Benjamin Kosnik

typelist_assoc_container.hpp: Remove, unused.

2006-09-20  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/pb_ds/detail/
	typelist_assoc_container.hpp: Remove, unused.
	* include/ext/pb_ds/detail/typelist/
	typelist_assoc_container_find.hpp: Same.
	* include/ext/pb_ds/detail/typelist: Remove.	
	* include/ext/pb_ds/detail/typelist.hpp: Merge...
	* include/ext/pb_ds/detail/typelist/typelist_flatten.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_contains.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_typelist_append.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_apply.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_append.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_at_index.hpp: Same.
	* include/ext/pb_ds/detail/typelist/typelist_transform.hpp: Same.
	* include/ext/typelist.h: ... into this.
	* include/Makefile.am: Subtractions.
	* include/Makefile.in: Regenerate.

	* include/ext/pb_ds/assoc_container.hpp: Fixups for new includes,
	namespaces, and names.	
	* include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	hash_prime_size_policy_imp.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	cc_hash_max_collision_check_resize_trigger_imp.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	sample_resize_policy.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	sample_resize_trigger.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	hash_exponential_size_policy_imp.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	hash_load_check_resize_trigger_size_base.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	hash_load_check_resize_trigger_imp.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	hash_standard_resize_policy_imp.hpp: Same.
	* include/ext/pb_ds/detail/container_base_dispatch.hpp: Same.
	* testsuite/performance/ext/pb_ds/text_find_timing.cc
	* testsuite/performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc
	* testsuite/performance/ext/pb_ds/tree_text_insert_timing.cc
	* testsuite/performance/ext/pb_ds/priority_queue_text_push_timing.cc
	* testsuite/performance/ext/pb_ds/random_int_subscript_find_timing.cc
	* testsuite/performance/ext/pb_ds/tree_split_join_timing.cc
	* testsuite/performance/ext/pb_ds/random_int_find_timing.cc
	* testsuite/performance/ext/pb_ds/
	multimap_text_insert_mem_usage.hpp: Same.
	* testsuite/performance/ext/pb_ds/
	priority_queue_random_int_push_timing.cc
	* testsuite/performance/ext/pb_ds/multimap_text_find_timing.hpp: Same.
	* testsuite/performance/ext/pb_ds/
	priority_queue_text_modify_timing.hpp: Same.
	* testsuite/performance/ext/pb_ds/tree_order_statistics_timing.cc
	* testsuite/performance/ext/pb_ds/
	priority_queue_text_push_pop_timing.cc
	* testsuite/performance/ext/pb_ds/priority_queue_text_join_timing.cc
	* testsuite/performance/ext/pb_ds/
	priority_queue_random_int_push_pop_timing.cc
	* testsuite/performance/ext/pb_ds/random_int_subscript_insert_timing.cc
	* testsuite/performance/ext/pb_ds/tree_text_lor_find_timing.cc
	* testsuite/performance/ext/pb_ds/
	multimap_text_insert_timing.hpp: Same.
	* testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem_usage.cc
	* testsuite/performance/ext/pb_ds/hash_zlob_random_int_find_timing.cc
	* testsuite/performance/23_containers/find/map.cc
	* testsuite/performance/23_containers/create/map.cc
	* testsuite/performance/23_containers/insert_erase/associative.cc
	* testsuite/performance/23_containers/insert/sequence.cc
	* testsuite/performance/23_containers/insert/associative.cc
	* testsuite/performance/23_containers/create_from_sorted/set.cc
	* testsuite/performance/23_containers/index/map.cc
	* testsuite/performance/23_containers/insert_from_sorted/set.cc
	* testsuite/performance/23_containers/create_sort/list.cc
	* testsuite/performance/23_containers/sort_search/list.cc
	* testsuite/performance/23_containers/producer_consumer/sequence.cc
	* testsuite/performance/23_containers/producer_consumer/associative.cc
	* testsuite/util/regression/trait/assoc/type_trait.hpp: Same.
	* testsuite/util/regression/rand/priority_queue/
	rand_regression_test.hpp: Same.
	* testsuite/util/regression/rand/assoc/rand_regression_test.hpp: Same.
	* testsuite/util/regression/assoc/common_type.hpp: Same.
	* testsuite/util/native_type/assoc/native_multimap.hpp: Same.
	* testsuite/util/native_type/assoc/native_tree_tag.hpp: Same.
	* testsuite/util/native_type/assoc/native_hash_multimap.hpp: Same.
	* testsuite/util/native_type/assoc/native_set.hpp: Same.
	* testsuite/util/native_type/assoc/native_map.hpp: Same.
	* testsuite/util/native_type/assoc/native_hash_set.hpp: Same.
	* testsuite/util/native_type/assoc/native_hash_map.hpp: Same.
	* testsuite/util/common_type/priority_queue/common_type.hpp: Same.
	* testsuite/util/common_type/assoc/common_type.hpp: Same.
	* testsuite/util/common_type/assoc/string_form.hpp: Same.
	* testsuite/util/common_type/assoc/template_policy.hpp: Same.
	* testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp: 
	Same.
	* testsuite/util/performance/priority_queue/timing/push_pop_test.hpp: 
	Same.
	* testsuite/util/performance/priority_queue/timing/join_test.hpp: Same.
	* testsuite/util/performance/priority_queue/timing/push_test.hpp: Same.
	* testsuite/util/performance/priority_queue/timing/modify_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/mem_usage/erase_test.hpp: Same.
	* testsuite/util/performance/assoc/timing/common_type.hpp: Same.
	* testsuite/util/performance/assoc/timing/multimap_insert_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/timing/subscript_find_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/timing/find_test.hpp: Same.
	* testsuite/util/performance/assoc/timing/subscript_insert_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/timing/insert_test.hpp: Same.
	* testsuite/util/performance/assoc/timing/
	tree_order_statistics_test.hpp: Same.
	* testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same.
	* testsuite/util/performance/assoc/timing/tree_split_join_test.hpp: 
	Same.
	* testsuite/util/performance/assoc/multimap_common_type.hpp: Same.

	* testsuite/ext/pb_ds/example/hash_resize_neg.cc: Fixup line numbers.

From-SVN: r117081
parent a186e616
2006-09-20 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/pb_ds/detail/
typelist_assoc_container.hpp: Remove, unused.
* include/ext/pb_ds/detail/typelist/
typelist_assoc_container_find.hpp: Same.
* include/ext/pb_ds/detail/typelist: Remove.
* include/ext/pb_ds/detail/typelist.hpp: Merge...
* include/ext/pb_ds/detail/typelist/typelist_flatten.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_contains.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_typelist_append.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_apply.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_append.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_at_index.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_transform.hpp: Same.
* include/ext/typelist.h: ... into this.
* include/Makefile.am: Subtractions.
* include/Makefile.in: Regenerate.
* include/ext/pb_ds/assoc_container.hpp: Fixups for new includes,
namespaces, and names.
* include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
hash_prime_size_policy_imp.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
cc_hash_max_collision_check_resize_trigger_imp.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
sample_resize_policy.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
sample_resize_trigger.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
hash_exponential_size_policy_imp.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
hash_load_check_resize_trigger_size_base.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
hash_load_check_resize_trigger_imp.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
hash_standard_resize_policy_imp.hpp: Same.
* include/ext/pb_ds/detail/container_base_dispatch.hpp: Same.
* testsuite/performance/ext/pb_ds/text_find_timing.cc
* testsuite/performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc
* testsuite/performance/ext/pb_ds/tree_text_insert_timing.cc
* testsuite/performance/ext/pb_ds/priority_queue_text_push_timing.cc
* testsuite/performance/ext/pb_ds/random_int_subscript_find_timing.cc
* testsuite/performance/ext/pb_ds/tree_split_join_timing.cc
* testsuite/performance/ext/pb_ds/random_int_find_timing.cc
* testsuite/performance/ext/pb_ds/
multimap_text_insert_mem_usage.hpp: Same.
* testsuite/performance/ext/pb_ds/
priority_queue_random_int_push_timing.cc
* testsuite/performance/ext/pb_ds/multimap_text_find_timing.hpp: Same.
* testsuite/performance/ext/pb_ds/
priority_queue_text_modify_timing.hpp: Same.
* testsuite/performance/ext/pb_ds/tree_order_statistics_timing.cc
* testsuite/performance/ext/pb_ds/
priority_queue_text_push_pop_timing.cc
* testsuite/performance/ext/pb_ds/priority_queue_text_join_timing.cc
* testsuite/performance/ext/pb_ds/
priority_queue_random_int_push_pop_timing.cc
* testsuite/performance/ext/pb_ds/random_int_subscript_insert_timing.cc
* testsuite/performance/ext/pb_ds/tree_text_lor_find_timing.cc
* testsuite/performance/ext/pb_ds/
multimap_text_insert_timing.hpp: Same.
* testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem_usage.cc
* testsuite/performance/ext/pb_ds/hash_zlob_random_int_find_timing.cc
* testsuite/performance/23_containers/find/map.cc
* testsuite/performance/23_containers/create/map.cc
* testsuite/performance/23_containers/insert_erase/associative.cc
* testsuite/performance/23_containers/insert/sequence.cc
* testsuite/performance/23_containers/insert/associative.cc
* testsuite/performance/23_containers/create_from_sorted/set.cc
* testsuite/performance/23_containers/index/map.cc
* testsuite/performance/23_containers/insert_from_sorted/set.cc
* testsuite/performance/23_containers/create_sort/list.cc
* testsuite/performance/23_containers/sort_search/list.cc
* testsuite/performance/23_containers/producer_consumer/sequence.cc
* testsuite/performance/23_containers/producer_consumer/associative.cc
* testsuite/util/regression/trait/assoc/type_trait.hpp: Same.
* testsuite/util/regression/rand/priority_queue/
rand_regression_test.hpp: Same.
* testsuite/util/regression/rand/assoc/rand_regression_test.hpp: Same.
* testsuite/util/regression/assoc/common_type.hpp: Same.
* testsuite/util/native_type/assoc/native_multimap.hpp: Same.
* testsuite/util/native_type/assoc/native_tree_tag.hpp: Same.
* testsuite/util/native_type/assoc/native_hash_multimap.hpp: Same.
* testsuite/util/native_type/assoc/native_set.hpp: Same.
* testsuite/util/native_type/assoc/native_map.hpp: Same.
* testsuite/util/native_type/assoc/native_hash_set.hpp: Same.
* testsuite/util/native_type/assoc/native_hash_map.hpp: Same.
* testsuite/util/common_type/priority_queue/common_type.hpp: Same.
* testsuite/util/common_type/assoc/common_type.hpp: Same.
* testsuite/util/common_type/assoc/string_form.hpp: Same.
* testsuite/util/common_type/assoc/template_policy.hpp: Same.
* testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp:
Same.
* testsuite/util/performance/priority_queue/timing/push_pop_test.hpp:
Same.
* testsuite/util/performance/priority_queue/timing/join_test.hpp: Same.
* testsuite/util/performance/priority_queue/timing/push_test.hpp: Same.
* testsuite/util/performance/priority_queue/timing/modify_test.hpp:
Same.
* testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp:
Same.
* testsuite/util/performance/assoc/mem_usage/erase_test.hpp: Same.
* testsuite/util/performance/assoc/timing/common_type.hpp: Same.
* testsuite/util/performance/assoc/timing/multimap_insert_test.hpp:
Same.
* testsuite/util/performance/assoc/timing/subscript_find_test.hpp:
Same.
* testsuite/util/performance/assoc/timing/find_test.hpp: Same.
* testsuite/util/performance/assoc/timing/subscript_insert_test.hpp:
Same.
* testsuite/util/performance/assoc/timing/insert_test.hpp: Same.
* testsuite/util/performance/assoc/timing/
tree_order_statistics_test.hpp: Same.
* testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same.
* testsuite/util/performance/assoc/timing/tree_split_join_test.hpp:
Same.
* testsuite/util/performance/assoc/multimap_common_type.hpp: Same.
* testsuite/ext/pb_ds/example/hash_resize_neg.cc: Fixup line numbers.
2006-09-19 Paolo Carlini <pcarlini@suse.de> 2006-09-19 Paolo Carlini <pcarlini@suse.de>
* include/tr1/hashtable_policy.h: Uglify all the names. * include/tr1/hashtable_policy.h: Uglify all the names.
......
...@@ -204,7 +204,6 @@ pb_subdirs = \ ...@@ -204,7 +204,6 @@ pb_subdirs = \
${pb_builddir}/detail/pairing_heap_ \ ${pb_builddir}/detail/pairing_heap_ \
${pb_builddir}/detail/splay_tree_ \ ${pb_builddir}/detail/splay_tree_ \
${pb_builddir}/detail/list_update_map_ \ ${pb_builddir}/detail/list_update_map_ \
${pb_builddir}/detail/typelist \
${pb_builddir}/detail/basic_tree_policy \ ${pb_builddir}/detail/basic_tree_policy \
${pb_builddir}/detail/trie_policy \ ${pb_builddir}/detail/trie_policy \
${pb_builddir}/detail/gp_hash_table_map_ \ ${pb_builddir}/detail/gp_hash_table_map_ \
...@@ -503,17 +502,6 @@ pb_headers7 = \ ...@@ -503,17 +502,6 @@ pb_headers7 = \
${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \ ${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \
${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \ ${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \ ${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \
${pb_srcdir}/detail/typelist_assoc_container.hpp \
${pb_srcdir}/detail/typelist.hpp \
${pb_srcdir}/detail/typelist/typelist_append.hpp \
${pb_srcdir}/detail/typelist/typelist_apply.hpp \
${pb_srcdir}/detail/typelist/typelist_assoc_container_find.hpp \
${pb_srcdir}/detail/typelist/typelist_at_index.hpp \
${pb_srcdir}/detail/typelist/typelist_contains.hpp \
${pb_srcdir}/detail/typelist/typelist_filter.hpp \
${pb_srcdir}/detail/typelist/typelist_flatten.hpp \
${pb_srcdir}/detail/typelist/typelist_transform.hpp \
${pb_srcdir}/detail/typelist/typelist_typelist_append.hpp \
${pb_srcdir}/detail/types_traits.hpp \ ${pb_srcdir}/detail/types_traits.hpp \
${pb_srcdir}/detail/type_utils.hpp \ ${pb_srcdir}/detail/type_utils.hpp \
${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \ ${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \
......
...@@ -427,7 +427,6 @@ pb_subdirs = \ ...@@ -427,7 +427,6 @@ pb_subdirs = \
${pb_builddir}/detail/pairing_heap_ \ ${pb_builddir}/detail/pairing_heap_ \
${pb_builddir}/detail/splay_tree_ \ ${pb_builddir}/detail/splay_tree_ \
${pb_builddir}/detail/list_update_map_ \ ${pb_builddir}/detail/list_update_map_ \
${pb_builddir}/detail/typelist \
${pb_builddir}/detail/basic_tree_policy \ ${pb_builddir}/detail/basic_tree_policy \
${pb_builddir}/detail/trie_policy \ ${pb_builddir}/detail/trie_policy \
${pb_builddir}/detail/gp_hash_table_map_ \ ${pb_builddir}/detail/gp_hash_table_map_ \
...@@ -726,17 +725,6 @@ pb_headers7 = \ ...@@ -726,17 +725,6 @@ pb_headers7 = \
${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \ ${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \
${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \ ${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \ ${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \
${pb_srcdir}/detail/typelist_assoc_container.hpp \
${pb_srcdir}/detail/typelist.hpp \
${pb_srcdir}/detail/typelist/typelist_append.hpp \
${pb_srcdir}/detail/typelist/typelist_apply.hpp \
${pb_srcdir}/detail/typelist/typelist_assoc_container_find.hpp \
${pb_srcdir}/detail/typelist/typelist_at_index.hpp \
${pb_srcdir}/detail/typelist/typelist_contains.hpp \
${pb_srcdir}/detail/typelist/typelist_filter.hpp \
${pb_srcdir}/detail/typelist/typelist_flatten.hpp \
${pb_srcdir}/detail/typelist/typelist_transform.hpp \
${pb_srcdir}/detail/typelist/typelist_typelist_append.hpp \
${pb_srcdir}/detail/types_traits.hpp \ ${pb_srcdir}/detail/types_traits.hpp \
${pb_srcdir}/detail/type_utils.hpp \ ${pb_srcdir}/detail/type_utils.hpp \
${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \ ${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#ifndef PB_DS_ASSOC_CNTNR_HPP #ifndef PB_DS_ASSOC_CNTNR_HPP
#define PB_DS_ASSOC_CNTNR_HPP #define PB_DS_ASSOC_CNTNR_HPP
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <ext/pb_ds/tag_and_trait.hpp> #include <ext/pb_ds/tag_and_trait.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/detail/container_base_dispatch.hpp> #include <ext/pb_ds/detail/container_base_dispatch.hpp>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
namespace pb_ds namespace pb_ds
{ {
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type
// An abstract basic associative container. // An abstract basic associative container.
...@@ -117,10 +117,9 @@ namespace pb_ds ...@@ -117,10 +117,9 @@ namespace pb_ds
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
container_base<Key, Mapped, Tag, typename detail::typelist_append< \ container_base<Key, Mapped, Tag, typename __gnu_cxx::typelist::append< \
typename detail::typelist4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int,Store_Hash> >::type, \ typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int, Store_Hash> >::type, Policy_TL>::type, Allocator>
Policy_TL>::type, Allocator>
// An abstract basic hash-based associative container. // An abstract basic hash-based associative container.
template<typename Key, template<typename Key,
...@@ -154,10 +153,10 @@ namespace pb_ds ...@@ -154,10 +153,10 @@ namespace pb_ds
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
cc_hash_tag, \ cc_hash_tag, \
typename detail::typelist1<Comb_Hash_Fn>::type, Allocator> typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, Allocator>
// A concrete collision-chaining hash-based associative container. // A concrete collision-chaining hash-based associative container.
template<typename Key, template<typename Key,
...@@ -291,10 +290,10 @@ namespace pb_ds ...@@ -291,10 +290,10 @@ namespace pb_ds
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
gp_hash_tag, \ gp_hash_tag, \
typename detail::typelist2<Comb_Probe_Fn, Probe_Fn>::type, Allocator> typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, Allocator>
// A concrete general-probing hash-based associative container. // A concrete general-probing hash-based associative container.
template<typename Key, template<typename Key,
...@@ -490,7 +489,7 @@ namespace pb_ds ...@@ -490,7 +489,7 @@ namespace pb_ds
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \ basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \
typename detail::typelist2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator> typename __gnu_cxx::typelist::create2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator>
// A concrete basic tree-based associative container. // A concrete basic tree-based associative container.
template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>, template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>,
...@@ -561,7 +560,7 @@ namespace pb_ds ...@@ -561,7 +560,7 @@ namespace pb_ds
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \ basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \
typename detail::typelist2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator> typename __gnu_cxx::typelist::create2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator>
// A concrete basic trie-based associative container. // A concrete basic trie-based associative container.
template<typename Key, template<typename Key,
...@@ -632,9 +631,9 @@ namespace pb_ds ...@@ -632,9 +631,9 @@ namespace pb_ds
#undef PB_DS_TRIE_NODE_AND_ITS_TRAITS #undef PB_DS_TRIE_NODE_AND_ITS_TRAITS
#define PB_DS_BASE_C_DEC \ #define PB_DS_BASE_C_DEC \
container_base<Key, Mapped, list_update_tag, \ container_base<Key, Mapped, list_update_tag, \
typename detail::typelist2<Eq_Fn, Update_Policy>::type, Allocator> typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type, Allocator>
// A list-update based associative container. // A list-update based associative container.
template<typename Key, template<typename Key,
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP #ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
#define PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP #define PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#define PB_DS_DATA_TRUE_INDICATOR #define PB_DS_DATA_TRUE_INDICATOR
#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp> #include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
...@@ -107,303 +107,232 @@ ...@@ -107,303 +107,232 @@
namespace pb_ds namespace pb_ds
{ {
namespace detail namespace detail
{
// Primary template.
template<typename Key, typename Mapped, typename Data_Structure_Taq,
typename Policy_Tl, typename Alloc>
struct container_base_dispatch;
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
struct container_base_dispatch<Key, Mapped, list_update_tag,
Policy_Tl, Alloc>
{
private:
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
typedef typename at0::type at0t;
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
typedef typename at1::type at1t;
public:
typedef lu_map_data_<Key, Mapped, at0t, Alloc, at1t> type;
};
template<typename Key, typename Policy_Tl, typename Alloc>
struct container_base_dispatch<Key, null_mapped_type, list_update_tag,
Policy_Tl, Alloc>
{
private:
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
typedef typename at0::type at0t;
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
typedef typename at1::type at1t;
public:
typedef lu_map_no_data_<Key, null_mapped_type, at0t, Alloc, at1t> type;
};
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
struct container_base_dispatch<Key, Mapped, pat_trie_tag, Policy_Tl, Alloc>
{ {
private:
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
typedef typename at1::type at1t;
template<typename Key, public:
typename Mapped, typedef pat_trie_data_<Key, Mapped, at1t, Alloc> type;
class Data_Structure_Taq, };
class Policy_Tl,
class Allocator> template<typename Key, typename Policy_Tl, typename Alloc>
struct container_base_dispatch; struct container_base_dispatch<Key, null_mapped_type, pat_trie_tag,
Policy_Tl, Alloc>
template<typename Key, {
typename Mapped, private:
class Policy_Tl, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
class Allocator> typedef typename at1::type at1t;
struct container_base_dispatch<
Key, public:
Mapped, typedef pat_trie_no_data_<Key, null_mapped_type, at1t, Alloc> type;
list_update_tag, };
Policy_Tl,
Allocator> template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
{ struct container_base_dispatch<Key, Mapped, rb_tree_tag, Policy_Tl, Alloc>
typedef {
lu_map_data_< private:
Key, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
Mapped, typedef typename at0::type at0t;
typename typelist_at_index<Policy_Tl, 0>::type, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
Allocator, typedef typename at1::type at1t;
typename typelist_at_index<Policy_Tl, 1>::type>
type; public:
}; typedef rb_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
};
template<typename Key, class Policy_Tl, class Allocator>
struct container_base_dispatch< template<typename Key, typename Policy_Tl, typename Alloc>
Key, struct container_base_dispatch<Key, null_mapped_type, rb_tree_tag,
null_mapped_type, Policy_Tl, Alloc>
list_update_tag, {
Policy_Tl, private:
Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
{ typedef typename at0::type at0t;
typedef typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
lu_map_no_data_< typedef typename at1::type at1t;
Key,
null_mapped_type, public:
typename typelist_at_index<Policy_Tl, 0>::type, typedef rb_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
Allocator, };
typename typelist_at_index<Policy_Tl, 1>::type>
type; template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
}; struct container_base_dispatch<Key, Mapped, splay_tree_tag,
Policy_Tl, Alloc>
template<typename Key, {
typename Mapped, private:
class Policy_Tl, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
class Allocator> typedef typename at0::type at0t;
struct container_base_dispatch< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
Key, typedef typename at1::type at1t;
Mapped,
pat_trie_tag, public:
Policy_Tl, typedef splay_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
Allocator> };
{
typedef template<typename Key, typename Policy_Tl, typename Alloc>
pat_trie_data_< struct container_base_dispatch<Key, null_mapped_type, splay_tree_tag,
Key, Policy_Tl, Alloc>
Mapped, {
typename typelist_at_index<Policy_Tl, 1>::type, private:
Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
type; typedef typename at0::type at0t;
}; typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
typedef typename at1::type at1t;
template<typename Key, class Policy_Tl, class Allocator>
struct container_base_dispatch< public:
Key, typedef splay_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
null_mapped_type, };
pat_trie_tag,
Policy_Tl, template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
Allocator> struct container_base_dispatch<Key, Mapped, ov_tree_tag, Policy_Tl, Alloc>
{ {
typedef private:
pat_trie_no_data_< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
Key, typedef typename at0::type at0t;
null_mapped_type, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
typename typelist_at_index<Policy_Tl, 1>::type, typedef typename at1::type at1t;
Allocator>
type; public:
}; typedef ov_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
};
template<typename Key,
typename Mapped, template<typename Key, typename Policy_Tl, typename Alloc>
class Policy_Tl, struct container_base_dispatch<Key, null_mapped_type, ov_tree_tag,
class Allocator> Policy_Tl, Alloc>
struct container_base_dispatch< {
Key, private:
Mapped, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
rb_tree_tag, typedef typename at0::type at0t;
Policy_Tl, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
Allocator> typedef typename at1::type at1t;
{
typedef public:
rb_tree_data_< typedef ov_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
Key, };
Mapped,
typename typelist_at_index<Policy_Tl, 0>::type, template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
typename typelist_at_index<Policy_Tl, 1>::type, struct container_base_dispatch<Key, Mapped, cc_hash_tag, Policy_Tl, Alloc>
Allocator> {
type; private:
}; typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
typedef typename at0::type at0t;
template<typename Key, class Policy_Tl, class Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
struct container_base_dispatch< typedef typename at1::type at1t;
Key, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
null_mapped_type, typedef typename at2::type at2t;
rb_tree_tag, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
Policy_Tl, typedef typename at3::type at3t;
Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
{ typedef typename at4::type at4t;
typedef
rb_tree_no_data_< public:
Key, typedef cc_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
null_mapped_type, at4t, at2t> type;
typename typelist_at_index<Policy_Tl, 0>::type, };
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator> template<typename Key, typename Policy_Tl, typename Alloc>
type; struct container_base_dispatch<Key, null_mapped_type, cc_hash_tag,
}; Policy_Tl, Alloc>
{
template<typename Key, private:
typename Mapped, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
class Policy_Tl, typedef typename at0::type at0t;
class Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
struct container_base_dispatch< typedef typename at1::type at1t;
Key, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
Mapped, typedef typename at2::type at2t;
splay_tree_tag, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
Policy_Tl, typedef typename at3::type at3t;
Allocator> typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
typedef typename at4::type at4t;
{
typedef public:
splay_tree_data_< typedef cc_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
Key, at3t::value, at4t, at2t> type;
Mapped, };
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type, template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
Allocator> struct container_base_dispatch<Key, Mapped, gp_hash_tag, Policy_Tl, Alloc>
type; {
}; private:
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
template<typename Key, class Policy_Tl, class Allocator> typedef typename at0::type at0t;
struct container_base_dispatch< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
Key, typedef typename at1::type at1t;
null_mapped_type, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
splay_tree_tag, typedef typename at2::type at2t;
Policy_Tl, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
Allocator> typedef typename at3::type at3t;
{ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
typedef typedef typename at4::type at4t;
splay_tree_no_data_< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
Key, typedef typename at5::type at5t;
null_mapped_type,
typename typelist_at_index<Policy_Tl, 0>::type, public:
typename typelist_at_index<Policy_Tl, 1>::type, typedef gp_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
Allocator> at4t, at5t, at2t> type;
type; };
};
template<typename Key, typename Policy_Tl, typename Alloc>
template<typename Key, struct container_base_dispatch<Key, null_mapped_type, gp_hash_tag,
typename Mapped, Policy_Tl, Alloc>
class Policy_Tl, {
class Allocator> private:
struct container_base_dispatch< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
Key, typedef typename at0::type at0t;
Mapped, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
ov_tree_tag, typedef typename at1::type at1t;
Policy_Tl, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
Allocator> typedef typename at2::type at2t;
{ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
typedef typedef typename at3::type at3t;
ov_tree_data_< typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
Key, typedef typename at4::type at4t;
Mapped, typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
typename typelist_at_index<Policy_Tl, 0>::type, typedef typename at5::type at5t;
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator> public:
type; typedef gp_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
}; at3t::value, at4t, at5t, at2t> type;
};
template<typename Key, class Policy_Tl, class Allocator> } // namespace detail
struct container_base_dispatch<
Key,
null_mapped_type,
ov_tree_tag,
Policy_Tl,
Allocator>
{
typedef
ov_tree_no_data_<
Key,
null_mapped_type,
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator>
type;
};
template<typename Key,
typename Mapped,
class Policy_Tl,
class Allocator>
struct container_base_dispatch<
Key,
Mapped,
cc_hash_tag,
Policy_Tl,
Allocator>
{
typedef
cc_ht_map_data_<
Key,
Mapped,
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator,
typelist_at_index<Policy_Tl, 3>::type::value,
typename typelist_at_index<Policy_Tl, 4>::type,
typename typelist_at_index<Policy_Tl, 2>::type>
type;
};
template<typename Key, class Policy_Tl, class Allocator>
struct container_base_dispatch<
Key,
null_mapped_type,
cc_hash_tag,
Policy_Tl,
Allocator>
{
typedef
cc_ht_map_no_data_<
Key,
null_mapped_type,
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator,
typelist_at_index<Policy_Tl, 3>::type::value,
typename typelist_at_index<Policy_Tl, 4>::type,
typename typelist_at_index<Policy_Tl, 2>::type>
type;
};
template<typename Key,
typename Mapped,
class Policy_Tl,
class Allocator>
struct container_base_dispatch<
Key,
Mapped,
gp_hash_tag,
Policy_Tl,
Allocator>
{
typedef
gp_ht_map_data_<
Key,
Mapped,
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator,
typelist_at_index<Policy_Tl, 3>::type::value,
typename typelist_at_index<Policy_Tl, 4>::type,
typename typelist_at_index<Policy_Tl, 5>::type,
typename typelist_at_index<Policy_Tl, 2>::type>
type;
};
template<typename Key, class Policy_Tl, class Allocator>
struct container_base_dispatch<
Key,
null_mapped_type,
gp_hash_tag,
Policy_Tl,
Allocator>
{
typedef
gp_ht_map_no_data_<
Key,
null_mapped_type,
typename typelist_at_index<Policy_Tl, 0>::type,
typename typelist_at_index<Policy_Tl, 1>::type,
Allocator,
typelist_at_index<Policy_Tl, 3>::type::value,
typename typelist_at_index<Policy_Tl, 4>::type,
typename typelist_at_index<Policy_Tl, 5>::type,
typename typelist_at_index<Policy_Tl, 2>::type>
type;
};
} // namespace detail
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP #endif
...@@ -44,9 +44,8 @@ ...@@ -44,9 +44,8 @@
* Contains a resize trigger implementation. * Contains a resize trigger implementation.
*/ */
#define PB_DS_STATIC_ASSERT(UNIQUE, E) \ #define PB_DS_STATIC_ASSERT(UNIQUE, E) \
typedef detail::static_assert_dumclass<sizeof(detail::static_assert<(bool)(E)>)> \ typedef detail::static_assert_dumclass<sizeof(detail::static_assert<(bool)(E)>)> UNIQUE##static_assert_type
UNIQUE##static_assert_type
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
...@@ -80,25 +79,19 @@ PB_DS_CLASS_T_DEC ...@@ -80,25 +79,19 @@ PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_start() notify_insert_search_start()
{ { m_num_col = 0; }
m_num_col = 0;
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_collision() notify_insert_search_collision()
{ { ++m_num_col; }
++m_num_col;
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_end() notify_insert_search_end()
{ { calc_resize_needed(); }
calc_resize_needed();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
...@@ -121,40 +114,32 @@ notify_erase_search_end() ...@@ -121,40 +114,32 @@ notify_erase_search_end()
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_inserted(size_type /*num_e*/) notify_inserted(size_type)
{ } { }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_erased(size_type /*num_e*/) notify_erased(size_type)
{ { m_resize_needed = true; }
m_resize_needed = true;
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_cleared() notify_cleared()
{ { m_resize_needed = false; }
m_resize_needed = false;
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline bool inline bool
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
is_resize_needed() const is_resize_needed() const
{ { return m_resize_needed; }
return (m_resize_needed);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline bool inline bool
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
is_grow_needed(size_type /*size*/, size_type /*num_used_e*/) const is_grow_needed(size_type /*size*/, size_type /*num_used_e*/) const
{ { return m_num_col >= m_max_col; }
return (m_num_col >= m_max_col);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
...@@ -164,14 +149,12 @@ notify_resized(size_type new_size) ...@@ -164,14 +149,12 @@ notify_resized(size_type new_size)
m_size = new_size; m_size = new_size;
#ifdef PB_DS_HT_MAP_RESIZE_TRACE_ #ifdef PB_DS_HT_MAP_RESIZE_TRACE_
std::cerr << "chmccrt::notify_resized " << std::cerr << "chmccrt::notify_resized "
static_cast<unsigned long>(new_size) << std::endl; << static_cast<unsigned long>(new_size) << std::endl;
#endif // #ifdef PB_DS_HT_MAP_RESIZE_TRACE_ #endif
calc_max_num_coll(); calc_max_num_coll();
calc_resize_needed(); calc_resize_needed();
m_num_col = 0; m_num_col = 0;
} }
...@@ -181,25 +164,21 @@ PB_DS_CLASS_C_DEC:: ...@@ -181,25 +164,21 @@ PB_DS_CLASS_C_DEC::
calc_max_num_coll() calc_max_num_coll()
{ {
// max_col <-- \sqrt{2 load \ln( 2 m \ln( m ) ) } // max_col <-- \sqrt{2 load \ln( 2 m \ln( m ) ) }
const double ln_arg = 2 * m_size * ::log(double(m_size));
const double ln_arg = 2* m_size* ::log( (double)m_size); m_max_col = size_type(::ceil(::sqrt(2 * m_load * ::log(ln_arg))));
m_max_col =(size_type)::ceil( ::sqrt(2* m_load* ::log(ln_arg) ) );
#ifdef PB_DS_HT_MAP_RESIZE_TRACE_ #ifdef PB_DS_HT_MAP_RESIZE_TRACE_
std::cerr << "chmccrt::calc_max_num_coll " << std::cerr << "chmccrt::calc_max_num_coll "
static_cast<unsigned long>(m_size) << " " << << static_cast<unsigned long>(m_size) << " "
static_cast<unsigned long>(m_max_col) << std::endl; << static_cast<unsigned long>(m_max_col) << std::endl;
#endif // #ifdef PB_DS_HT_MAP_RESIZE_TRACE_ #endif
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_externally_resized(size_type new_size) notify_externally_resized(size_type new_size)
{ { notify_resized(new_size); }
notify_resized(new_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
...@@ -207,13 +186,9 @@ PB_DS_CLASS_C_DEC:: ...@@ -207,13 +186,9 @@ PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other) swap(PB_DS_CLASS_C_DEC& other)
{ {
std::swap(m_load, other.m_load); std::swap(m_load, other.m_load);
std::swap(m_size, other.m_size); std::swap(m_size, other.m_size);
std::swap(m_num_col, other.m_num_col); std::swap(m_num_col, other.m_num_col);
std::swap(m_max_col, other.m_max_col); std::swap(m_max_col, other.m_max_col);
std::swap(m_resize_needed, other.m_resize_needed); std::swap(m_resize_needed, other.m_resize_needed);
} }
...@@ -223,18 +198,14 @@ PB_DS_CLASS_C_DEC:: ...@@ -223,18 +198,14 @@ PB_DS_CLASS_C_DEC::
get_load() const get_load() const
{ {
PB_DS_STATIC_ASSERT(access, external_load_access); PB_DS_STATIC_ASSERT(access, external_load_access);
return m_load;
return (m_load);
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
calc_resize_needed() calc_resize_needed()
{ { m_resize_needed = m_resize_needed || m_num_col >= m_max_col; }
m_resize_needed =
m_resize_needed || m_num_col >= m_max_col;
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
...@@ -242,11 +213,8 @@ PB_DS_CLASS_C_DEC:: ...@@ -242,11 +213,8 @@ PB_DS_CLASS_C_DEC::
set_load(float load) set_load(float load)
{ {
PB_DS_STATIC_ASSERT(access, external_load_access); PB_DS_STATIC_ASSERT(access, external_load_access);
m_load = load; m_load = load;
calc_max_num_coll(); calc_max_num_coll();
calc_resize_needed(); calc_resize_needed();
} }
......
...@@ -57,7 +57,6 @@ PB_DS_CLASS_C_DEC:: ...@@ -57,7 +57,6 @@ PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other) swap(PB_DS_CLASS_C_DEC& other)
{ {
std::swap(m_start_size, other.m_start_size); std::swap(m_start_size, other.m_start_size);
std::swap(m_grow_factor, other.m_grow_factor); std::swap(m_grow_factor, other.m_grow_factor);
} }
...@@ -67,18 +66,14 @@ PB_DS_CLASS_C_DEC:: ...@@ -67,18 +66,14 @@ PB_DS_CLASS_C_DEC::
get_nearest_larger_size(size_type size) const get_nearest_larger_size(size_type size) const
{ {
size_type ret = m_start_size; size_type ret = m_start_size;
while (ret <= size) while (ret <= size)
{ {
const size_type next_ret = ret* m_grow_factor; const size_type next_ret = ret* m_grow_factor;
if (next_ret < ret) if (next_ret < ret)
throw insert_error(); throw insert_error();
ret = next_ret; ret = next_ret;
} }
return ret;
return (ret);
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
...@@ -87,20 +82,15 @@ PB_DS_CLASS_C_DEC:: ...@@ -87,20 +82,15 @@ PB_DS_CLASS_C_DEC::
get_nearest_smaller_size(size_type size) const get_nearest_smaller_size(size_type size) const
{ {
size_type ret = m_start_size; size_type ret = m_start_size;
while (true) while (true)
{ {
const size_type next_ret = ret* m_grow_factor; const size_type next_ret = ret* m_grow_factor;
if (next_ret < ret) if (next_ret < ret)
throw resize_error(); throw resize_error();
if (next_ret >= size) if (next_ret >= size)
return (ret); return (ret);
ret = next_ret; ret = next_ret;
} }
return ret;
return (ret);
} }
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
* Contains a resize trigger implementation. * Contains a resize trigger implementation.
*/ */
#define PB_DS_STATIC_ASSERT(UNIQUE, E) \ #define PB_DS_STATIC_ASSERT(UNIQUE, E) \
typedef detail::static_assert_dumclass<sizeof(detail::static_assert<(bool)(E)>)> UNIQUE##static_assert_type typedef detail::static_assert_dumclass<sizeof(detail::static_assert<bool(E)>)> UNIQUE##static_assert_type
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
......
...@@ -49,124 +49,52 @@ ...@@ -49,124 +49,52 @@
namespace pb_ds namespace pb_ds
{ {
namespace detail namespace detail
{ {
// Primary template.
template<typename Size_Type, bool Hold_Size> template<typename Size_Type, bool Hold_Size>
class hash_load_check_resize_trigger_size_base; class hash_load_check_resize_trigger_size_base;
#define PB_DS_CLASS_T_DEC \ // Specializations.
template<typename Size_Type> template<typename Size_Type>
class hash_load_check_resize_trigger_size_base<Size_Type, true>
#define PB_DS_CLASS_C_DEC \
hash_load_check_resize_trigger_size_base< \
Size_Type, \
true>
template<typename Size_Type>
class hash_load_check_resize_trigger_size_base<
Size_Type,
true>
{ {
protected: protected:
typedef Size_Type size_type; typedef Size_Type size_type;
protected: hash_load_check_resize_trigger_size_base(): m_size(0)
inline { }
hash_load_check_resize_trigger_size_base();
inline void inline void
swap(PB_DS_CLASS_C_DEC& other); swap(hash_load_check_resize_trigger_size_base& other)
{ std::swap(m_size, other.m_size); }
inline void inline void
set_size(size_type size); set_size(size_type size)
{ m_size = size; }
inline size_type inline size_type
get_size() const; get_size() const
{ return m_size; }
private: private:
size_type m_size; size_type m_size;
}; };
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
hash_load_check_resize_trigger_size_base() :
m_size(0)
{ }
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
set_size(size_type size)
{
m_size = size;
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
get_size() const
{
return (m_size);
}
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other)
{
std::swap(m_size, other.m_size);
}
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
#define PB_DS_CLASS_T_DEC \
template<typename Size_Type>
#define PB_DS_CLASS_C_DEC \
hash_load_check_resize_trigger_size_base< \
Size_Type, \
false>
template<typename Size_Type> template<typename Size_Type>
class hash_load_check_resize_trigger_size_base< class hash_load_check_resize_trigger_size_base<Size_Type, false>
Size_Type,
false>
{ {
protected: protected:
typedef Size_Type size_type; typedef Size_Type size_type;
protected: protected:
inline void inline void
swap(PB_DS_CLASS_C_DEC& other); swap(hash_load_check_resize_trigger_size_base& other) { }
inline void inline void
set_size(size_type size); set_size(size_type size) { }
}; };
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& /*other*/)
{ }
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
set_size(size_type /*size*/)
{
// Do nothing
}
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
} // namespace detail } // namespace detail
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_HASH_LOAD_CHECK_RESIZE_TRIGGER_SIZE_BASE_HPP #endif
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
namespace detail namespace detail
{ {
enum enum
{ {
num_distinct_sizes_32_bit = 30, num_distinct_sizes_32_bit = 30,
...@@ -57,7 +56,6 @@ namespace detail ...@@ -57,7 +56,6 @@ namespace detail
// Originally taken from the SGI implementation; acknowledged in the docs. // Originally taken from the SGI implementation; acknowledged in the docs.
// Further modified (for 64 bits) from tr1's hashtable. // Further modified (for 64 bits) from tr1's hashtable.
static const std::size_t g_a_sizes[num_distinct_sizes_64_bit] = static const std::size_t g_a_sizes[num_distinct_sizes_64_bit] =
{ {
/* 0 */ 5ul, /* 0 */ 5ul,
...@@ -129,33 +127,26 @@ namespace detail ...@@ -129,33 +127,26 @@ namespace detail
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline inline
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
hash_prime_size_policy(size_type start_size) : hash_prime_size_policy(size_type start_size) : m_start_size(start_size)
m_start_size(start_size) { m_start_size = get_nearest_larger_size(start_size); }
{
m_start_size =
get_nearest_larger_size(start_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other) swap(PB_DS_CLASS_C_DEC& other)
{ { std::swap(m_start_size, other.m_start_size); }
std::swap(m_start_size, other.m_start_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline PB_DS_CLASS_C_DEC::size_type inline PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_nearest_larger_size(size_type size) const get_nearest_larger_size(size_type size) const
{ {
const std::size_t* const p_upper = const std::size_t* const p_upper = std::upper_bound(detail::g_a_sizes,
std::upper_bound( detail::g_a_sizes, detail::g_a_sizes + detail::num_distinct_sizes, size); detail::g_a_sizes + detail::num_distinct_sizes, size);
if (p_upper == detail::g_a_sizes + detail::num_distinct_sizes) if (p_upper == detail::g_a_sizes + detail::num_distinct_sizes)
throw resize_error(); throw resize_error();
return *p_upper;
return (*p_upper);
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
...@@ -163,13 +154,12 @@ inline PB_DS_CLASS_C_DEC::size_type ...@@ -163,13 +154,12 @@ inline PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_nearest_smaller_size(size_type size) const get_nearest_smaller_size(size_type size) const
{ {
const size_t* p_lower = std::lower_bound( detail::g_a_sizes, detail::g_a_sizes + detail::num_distinct_sizes, size); const size_t* p_lower = std::lower_bound(detail::g_a_sizes,
detail::g_a_sizes + detail::num_distinct_sizes, size);
if (*p_lower >= size&& p_lower != detail::g_a_sizes) if (*p_lower >= size&& p_lower != detail::g_a_sizes)
--p_lower; --p_lower;
if (*p_lower < m_start_size) if (*p_lower < m_start_size)
return (m_start_size); return m_start_size;
return *p_lower;
return (*p_lower);
} }
...@@ -44,36 +44,30 @@ ...@@ -44,36 +44,30 @@
* Contains a resize policy implementation. * Contains a resize policy implementation.
*/ */
#define PB_DS_STATIC_ASSERT(UNIQUE, E) \ #define PB_DS_STATIC_ASSERT(UNIQUE, E) \
typedef detail::static_assert_dumclass<sizeof(detail::static_assert<(bool)(E)>)> \ typedef detail::static_assert_dumclass<sizeof(detail::static_assert<(bool)(E)>)> UNIQUE##static_assert_type
UNIQUE##static_assert_type
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
hash_standard_resize_policy() : hash_standard_resize_policy() :
m_size(Size_Policy::get_nearest_larger_size(1)) m_size(Size_Policy::get_nearest_larger_size(1))
{ { trigger_policy_base::notify_externally_resized(m_size); }
trigger_policy_base::notify_externally_resized(m_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
hash_standard_resize_policy(const Size_Policy& r_size_policy) : hash_standard_resize_policy(const Size_Policy& r_size_policy) :
Size_Policy(r_size_policy), Size_Policy(r_size_policy),
m_size(Size_Policy::get_nearest_larger_size(1)) m_size(Size_Policy::get_nearest_larger_size(1))
{ { trigger_policy_base::notify_externally_resized(m_size); }
trigger_policy_base::notify_externally_resized(m_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
hash_standard_resize_policy(const Size_Policy& r_size_policy, const Trigger_Policy& r_trigger_policy) : hash_standard_resize_policy(const Size_Policy& r_size_policy,
const Trigger_Policy& r_trigger_policy) :
Size_Policy(r_size_policy), Size_Policy(r_size_policy),
Trigger_Policy(r_trigger_policy), Trigger_Policy(r_trigger_policy),
m_size(Size_Policy::get_nearest_larger_size(1)) m_size(Size_Policy::get_nearest_larger_size(1))
{ { trigger_policy_base::notify_externally_resized(m_size); }
trigger_policy_base::notify_externally_resized(m_size);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
...@@ -86,9 +80,7 @@ PB_DS_CLASS_C_DEC:: ...@@ -86,9 +80,7 @@ PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other) swap(PB_DS_CLASS_C_DEC& other)
{ {
trigger_policy_base::swap(other); trigger_policy_base::swap(other);
size_policy_base::swap(other); size_policy_base::swap(other);
std::swap(m_size, other.m_size); std::swap(m_size, other.m_size);
} }
...@@ -96,105 +88,79 @@ PB_DS_CLASS_T_DEC ...@@ -96,105 +88,79 @@ PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_find_search_start() notify_find_search_start()
{ { trigger_policy_base::notify_find_search_start(); }
trigger_policy_base::notify_find_search_start();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_find_search_collision() notify_find_search_collision()
{ { trigger_policy_base::notify_find_search_collision(); }
trigger_policy_base::notify_find_search_collision();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_find_search_end() notify_find_search_end()
{ { trigger_policy_base::notify_find_search_end(); }
trigger_policy_base::notify_find_search_end();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_start() notify_insert_search_start()
{ { trigger_policy_base::notify_insert_search_start(); }
trigger_policy_base::notify_insert_search_start();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_collision() notify_insert_search_collision()
{ { trigger_policy_base::notify_insert_search_collision(); }
trigger_policy_base::notify_insert_search_collision();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_insert_search_end() notify_insert_search_end()
{ { trigger_policy_base::notify_insert_search_end(); }
trigger_policy_base::notify_insert_search_end();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_erase_search_start() notify_erase_search_start()
{ { trigger_policy_base::notify_erase_search_start(); }
trigger_policy_base::notify_erase_search_start();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_erase_search_collision() notify_erase_search_collision()
{ { trigger_policy_base::notify_erase_search_collision(); }
trigger_policy_base::notify_erase_search_collision();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_erase_search_end() notify_erase_search_end()
{ { trigger_policy_base::notify_erase_search_end(); }
trigger_policy_base::notify_erase_search_end();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_inserted(size_type num_e) notify_inserted(size_type num_e)
{ { trigger_policy_base::notify_inserted(num_e); }
trigger_policy_base::notify_inserted(num_e);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline void inline void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_erased(size_type num_e) notify_erased(size_type num_e)
{ { trigger_policy_base::notify_erased(num_e); }
trigger_policy_base::notify_erased(num_e);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
notify_cleared() notify_cleared()
{ { trigger_policy_base::notify_cleared(); }
trigger_policy_base::notify_cleared();
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
inline bool inline bool
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
is_resize_needed() const is_resize_needed() const
{ { return trigger_policy_base::is_resize_needed(); }
return (trigger_policy_base::is_resize_needed());
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
typename PB_DS_CLASS_C_DEC::size_type typename PB_DS_CLASS_C_DEC::size_type
...@@ -203,9 +169,8 @@ get_new_size(size_type size, size_type num_used_e) const ...@@ -203,9 +169,8 @@ get_new_size(size_type size, size_type num_used_e) const
{ {
if (trigger_policy_base:: if (trigger_policy_base::
is_grow_needed(size, num_used_e)) is_grow_needed(size, num_used_e))
return (size_policy_base::get_nearest_larger_size(size)); return size_policy_base::get_nearest_larger_size(size);
return size_policy_base::get_nearest_smaller_size(size);
return (size_policy_base::get_nearest_smaller_size(size));
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
...@@ -214,7 +179,6 @@ PB_DS_CLASS_C_DEC:: ...@@ -214,7 +179,6 @@ PB_DS_CLASS_C_DEC::
notify_resized(size_type new_size) notify_resized(size_type new_size)
{ {
trigger_policy_base::notify_resized(new_size); trigger_policy_base::notify_resized(new_size);
m_size = new_size; m_size = new_size;
} }
...@@ -224,8 +188,7 @@ PB_DS_CLASS_C_DEC:: ...@@ -224,8 +188,7 @@ PB_DS_CLASS_C_DEC::
get_actual_size() const get_actual_size() const
{ {
PB_DS_STATIC_ASSERT(access, external_size_access); PB_DS_STATIC_ASSERT(access, external_size_access);
return m_size;
return (m_size);
} }
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
...@@ -234,7 +197,6 @@ PB_DS_CLASS_C_DEC:: ...@@ -234,7 +197,6 @@ PB_DS_CLASS_C_DEC::
resize(size_type new_size) resize(size_type new_size)
{ {
PB_DS_STATIC_ASSERT(access, external_size_access); PB_DS_STATIC_ASSERT(access, external_size_access);
size_type actual_new_size = size_policy_base::get_nearest_larger_size(1); size_type actual_new_size = size_policy_base::get_nearest_larger_size(1);
while (actual_new_size < new_size) while (actual_new_size < new_size)
{ {
...@@ -243,7 +205,6 @@ resize(size_type new_size) ...@@ -243,7 +205,6 @@ resize(size_type new_size)
if (pot == actual_new_size&& pot < new_size) if (pot == actual_new_size&& pot < new_size)
throw resize_error(); throw resize_error();
actual_new_size = pot; actual_new_size = pot;
} }
...@@ -251,7 +212,6 @@ resize(size_type new_size) ...@@ -251,7 +212,6 @@ resize(size_type new_size)
--actual_new_size; --actual_new_size;
const size_type old_size = m_size; const size_type old_size = m_size;
try try
{ {
do_resize(actual_new_size - 1); do_resize(actual_new_size - 1);
...@@ -259,13 +219,11 @@ resize(size_type new_size) ...@@ -259,13 +219,11 @@ resize(size_type new_size)
catch(insert_error& ) catch(insert_error& )
{ {
m_size = old_size; m_size = old_size;
throw resize_error(); throw resize_error();
} }
catch(...) catch(...)
{ {
m_size = old_size; m_size = old_size;
throw; throw;
} }
} }
...@@ -273,7 +231,7 @@ resize(size_type new_size) ...@@ -273,7 +231,7 @@ resize(size_type new_size)
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
do_resize(size_type /*new_size*/) do_resize(size_type)
{ {
// Do nothing // Do nothing
} }
...@@ -282,33 +240,25 @@ PB_DS_CLASS_T_DEC ...@@ -282,33 +240,25 @@ PB_DS_CLASS_T_DEC
Trigger_Policy& Trigger_Policy&
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_trigger_policy() get_trigger_policy()
{ { return *this; }
return (*this);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
const Trigger_Policy& const Trigger_Policy&
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_trigger_policy() const get_trigger_policy() const
{ { return *this; }
return (*this);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
Size_Policy& Size_Policy&
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_size_policy() get_size_policy()
{ { return *this; }
return (*this);
}
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
const Size_Policy& const Size_Policy&
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
get_size_policy() const get_size_policy() const
{ { return *this; }
return (*this);
}
#undef PB_DS_STATIC_ASSERT #undef PB_DS_STATIC_ASSERT
...@@ -50,14 +50,11 @@ ...@@ -50,14 +50,11 @@
// A sample resize policy. // A sample resize policy.
class sample_resize_policy class sample_resize_policy
{ {
public: public:
// Size type. // Size type.
typedef size_t size_type; typedef size_t size_type;
public:
// Default constructor. // Default constructor.
sample_resize_policy(); sample_resize_policy();
...@@ -129,7 +126,6 @@ protected: ...@@ -129,7 +126,6 @@ protected:
// Queries what the new size should be. // Queries what the new size should be.
size_type size_type
get_new_size(size_type size, size_type num_used_e) const; get_new_size(size_type size, size_type num_used_e) const;
}; };
#endif // #ifndef PB_DS_SAMPLE_RESIZE_POLICY_HPP #endif
...@@ -50,14 +50,11 @@ ...@@ -50,14 +50,11 @@
// A sample resize trigger policy. // A sample resize trigger policy.
class sample_resize_trigger class sample_resize_trigger
{ {
public: public:
// Size type. // Size type.
typedef size_t size_type; typedef size_t size_type;
public:
// Default constructor. // Default constructor.
sample_resize_trigger(); sample_resize_trigger();
...@@ -106,7 +103,8 @@ protected: ...@@ -106,7 +103,8 @@ protected:
inline void inline void
notify_erase_search_end(); notify_erase_search_end();
// Notifies an element was inserted. the total number of entries in the table is num_entries. // Notifies an element was inserted. the total number of entries in
// the table is num_entries.
inline void inline void
notify_inserted(size_type num_entries); notify_inserted(size_type num_entries);
...@@ -118,7 +116,8 @@ protected: ...@@ -118,7 +116,8 @@ protected:
void void
notify_cleared(); notify_cleared();
// Notifies the table was resized as a result of this object's signifying that a resize is needed. // Notifies the table was resized as a result of this object's
// signifying that a resize is needed.
void void
notify_resized(size_type new_size); notify_resized(size_type new_size);
...@@ -139,9 +138,8 @@ private: ...@@ -139,9 +138,8 @@ private:
// Resizes to new_size. // Resizes to new_size.
virtual void virtual void
do_resize(size_type new_size); do_resize(size_type new_size);
}; };
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_SAMPLE_RESIZE_TRIGGER_HPP #endif
...@@ -50,14 +50,11 @@ ...@@ -50,14 +50,11 @@
// A sample size policy. // A sample size policy.
class sample_size_policy class sample_size_policy
{ {
public: public:
// Size type. // Size type.
typedef size_t size_type; typedef size_t size_type;
public:
// Default constructor. // Default constructor.
sample_size_policy(); sample_size_policy();
...@@ -77,7 +74,6 @@ protected: ...@@ -77,7 +74,6 @@ protected:
// Given a __size size, returns a __size that is smaller. // Given a __size size, returns a __size that is smaller.
inline size_type inline size_type
get_nearest_smaller_size(size_type size) const; get_nearest_smaller_size(size_type size) const;
}; };
#endif // #ifndef PB_DS_SAMPLE_SIZE_POLICY_HPP #endif
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist.hpp
* Contains typelist_chain definitions.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_HPP
#define PB_DS_TYPELIST_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace pb_ds
{
namespace detail
{
struct null_type
{ };
template<typename Hd, typename Tl>
struct typelist_chain
{
typedef Hd head;
typedef Tl tail;
};
template<typename Root>
struct typelist
{
typedef Root root;
};
#define PB_DS_TYPELIST_CHAIN1(X0) typelist_chain<X0, null_type>
#define PB_DS_TYPELIST_CHAIN2(X0, X1) typelist_chain<X0, PB_DS_TYPELIST_CHAIN1(X1) >
#define PB_DS_TYPELIST_CHAIN3(X0, X1, X2) typelist_chain<X0, PB_DS_TYPELIST_CHAIN2(X1, X2) >
#define PB_DS_TYPELIST_CHAIN4(X0, X1, X2, X3) typelist_chain<X0, PB_DS_TYPELIST_CHAIN3(X1, X2, X3) >
#define PB_DS_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) typelist_chain<X0, PB_DS_TYPELIST_CHAIN4(X1, X2, X3, X4) >
#define PB_DS_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) typelist_chain<X0, PB_DS_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >
#define PB_DS_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) typelist_chain<X0, PB_DS_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >
#define PB_DS_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) typelist_chain<X0, PB_DS_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >
#define PB_DS_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) typelist_chain<X0, PB_DS_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >
#define PB_DS_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) typelist_chain<X0, PB_DS_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >
#define PB_DS_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) typelist_chain<X0, PB_DS_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >
#define PB_DS_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) typelist_chain<X0, PB_DS_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >
#define PB_DS_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) typelist_chain<X0, PB_DS_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
#define PB_DS_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) typelist_chain<X0, PB_DS_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
#define PB_DS_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) typelist_chain<X0, PB_DS_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
#include <ext/pb_ds/detail/typelist/typelist_apply.hpp>
template<typename Fn, class Typelist>
void
typelist_apply(Fn& r_fn, Typelist)
{
detail::apply_<Fn, typename Typelist::root> a;
a(r_fn);
}
#include <ext/pb_ds/detail/typelist/typelist_append.hpp>
template<typename Typelist0, class Typelist1>
struct typelist_append
{
private:
typedef
typename detail::typelist_append_<
typename Typelist0::root,
typename Typelist1::root>::type
res_hd;
public:
typedef typelist< res_hd> type;
};
#include <ext/pb_ds/detail/typelist/typelist_typelist_append.hpp>
template<typename Typelist_Typelist>
struct typelist_typelist_append
{
private:
typedef
typename detail::typelist_typelist_append_<
typename Typelist_Typelist::root>::type
res_hd;
public:
typedef typelist< res_hd> type;
};
#include <ext/pb_ds/detail/typelist/typelist_contains.hpp>
template<typename Typelist, typename T>
struct typelist_contains
{
enum
{
value =
detail::typelist_contains_<
typename Typelist::root,
T>::value
};
};
#include <ext/pb_ds/detail/typelist/typelist_filter.hpp>
template<typename Typelist, template<typename T>
class Pred>
struct typelist_filter
{
private:
typedef
typename detail::typelist_chain_filter_<
typename Typelist::root,
Pred>::type
root_type;
public:
typedef typelist< root_type> type;
};
#include <ext/pb_ds/detail/typelist/typelist_at_index.hpp>
template<typename Typelist, int i>
struct typelist_at_index
{
typedef
typename detail::typelist_chain_at_index_<
typename Typelist::root,
i>::type
type;
};
#include <ext/pb_ds/detail/typelist/typelist_transform.hpp>
template<typename Typelist, template<typename T>
class Transform>
struct typelist_transform
{
private:
typedef
typename detail::typelist_chain_transform_<
typename Typelist::root,
Transform>::type
root_type;
public:
typedef typelist< root_type> type;
};
#include <ext/pb_ds/detail/typelist/typelist_flatten.hpp>
template<typename Typelist_Typelist>
struct typelist_flatten
{
private:
typedef
typename detail::typelist_chain_flatten_<
typename Typelist_Typelist::root>::type
root_type;
public:
typedef typelist< root_type> type;
};
template<typename Typelist>
struct typelist_from_first
{
private:
typedef typename typelist_at_index< Typelist, 0>::type first_type;
public:
typedef typelist< typelist_chain< first_type, null_type> > type;
};
template<typename T0>
struct typelist1
{
typedef typelist< PB_DS_TYPELIST_CHAIN1( T0)> type;
};
template<typename T0, typename T1>
struct typelist2
{
typedef
typelist<
PB_DS_TYPELIST_CHAIN2( T0, T1)>
type;
};
template<typename T0, typename T1, typename T2>
struct typelist3
{
typedef
typelist<
PB_DS_TYPELIST_CHAIN3( T0, T1, T2)>
type;
};
template<typename T0, typename T1, typename T2, typename T3>
struct typelist4
{
typedef
typelist<
PB_DS_TYPELIST_CHAIN4( T0, T1, T2, T3)>
type;
};
template<typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
struct typelist5
{
typedef
typelist<
PB_DS_TYPELIST_CHAIN5( T0, T1, T2, T3, T4)>
type;
};
template<typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
struct typelist6
{
typedef
typelist<
PB_DS_TYPELIST_CHAIN6( T0, T1, T2, T3, T4, T5)>
type;
};
#undef PB_DS_TYPELIST_CHAIN1
#undef PB_DS_TYPELIST_CHAIN2
#undef PB_DS_TYPELIST_CHAIN3
#undef PB_DS_TYPELIST_CHAIN4
#undef PB_DS_TYPELIST_CHAIN5
#undef PB_DS_TYPELIST_CHAIN6
#undef PB_DS_TYPELIST_CHAIN7
#undef PB_DS_TYPELIST_CHAIN8
#undef PB_DS_TYPELIST_CHAIN9
#undef PB_DS_TYPELIST_CHAIN10
#undef PB_DS_TYPELIST_CHAIN11
#undef PB_DS_TYPELIST_CHAIN12
#undef PB_DS_TYPELIST_CHAIN13
#undef PB_DS_TYPELIST_CHAIN14
#undef PB_DS_TYPELIST_CHAIN15
} // namespace detail
} // namespace pb_ds
#endif // #ifndef PB_DS_TYPELIST_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_append.hpp
* Contains typelist_chain utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_APPEND_HPP
#define PB_DS_TYPELIST_APPEND_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Chain0, class Typelist_Chain1>
struct typelist_append_;
template<typename Hd, typename Tl, class Typelist_Chain1>
struct typelist_append_<typelist_chain<Hd, Tl>, Typelist_Chain1>
{
typedef typelist_chain<Hd, typename typelist_append_<Tl, Typelist_Chain1>::type> type;
};
template<typename Typelist_Chain1>
struct typelist_append_< null_type, Typelist_Chain1>
{
typedef Typelist_Chain1 type;
};
template<typename Typelist_Chain0>
struct typelist_append_<Typelist_Chain0, null_type>
{
typedef Typelist_Chain0 type;
};
template<>
struct typelist_append_<null_type, null_type>
{
typedef null_type type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_APPEND_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_apply.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_APPLY_HPP
#define PB_DS_TYPELIST_APPLY_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Fn, class Typelist_Chain>
struct apply_;
template<typename Fn, class Hd, class Tl>
struct apply_<Fn, typelist_chain<Hd, Tl> >
{
void
operator()(Fn& r_fn)
{
r_fn(type_to_type<Hd>());
apply_<Fn, Tl> next;
next(r_fn);
}
};
template<typename Fn>
struct apply_<Fn, null_type>
{
void
operator()(Fn&) { }
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_APPLY_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_assoc_container_find.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_ASSOC_CNTNR_FIND_HPP
#define PB_DS_TYPELIST_ASSOC_CNTNR_FIND_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Tl, typename Key>
struct typelist_assoc_container_find_;
template<typename Now_Key, typename Now_Data, typename Rest_Tl, typename Key>
struct typelist_assoc_container_find_<
typelist_chain<std::pair<Now_Key, Now_Data>, Rest_Tl>, Key>
{
typedef typename typelist_assoc_container_find_< Rest_Tl, Key>::type type;
};
template<typename Now_Key, typename Now_Data, typename Rest_Tl>
struct typelist_assoc_container_find_<
typelist_chain<std::pair<Now_Key, Now_Data>, Rest_Tl>, Now_Key>
{
typedef Now_Data type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_ASSOC_CNTNR_FIND_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_at_index.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_AT_INDEX_HPP
#define PB_DS_TYPELIST_AT_INDEX_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Chain, int i>
struct typelist_chain_at_index_;
template<typename Hd, class Tl>
struct typelist_chain_at_index_<typelist_chain<Hd, Tl>, 0>
{
typedef Hd type;
};
template<typename Hd, class Tl, int i>
struct typelist_chain_at_index_<typelist_chain<Hd, Tl>, i>
{
typedef typename typelist_chain_at_index_< Tl, i - 1>::type type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_AT_INDEX_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_contains.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_CONTAINS_HPP
#define PB_DS_TYPELIST_CONTAINS_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Chain, class T>
struct typelist_contains_;
template<typename T>
struct typelist_contains_<null_type, T>
{
enum
{
value = false
};
};
template<typename Hd, class Tl, class T>
struct typelist_contains_<typelist_chain<Hd, Tl>, T>
{
enum
{
value = typelist_contains_<Tl, T>::value
};
};
template<typename Tl, class T>
struct typelist_contains_<typelist_chain<T, Tl>, T>
{
enum
{
value = true
};
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_CONTAINS_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_filter.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_FILTER_HPP
#define PB_DS_TYPELIST_FILTER_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Chain, template<typename T> class Pred>
struct typelist_chain_filter_;
template<template<typename T>
class Pred>
struct typelist_chain_filter_<null_type, Pred>
{
typedef null_type type;
};
template<typename Hd, class Tl, template<typename T> class Pred>
struct typelist_chain_filter_< typelist_chain<Hd, Tl>, Pred>
{
typedef typename typelist_chain_filter_< Tl, Pred>::type rest;
enum
{
include_hd = Pred<Hd>::value
};
typedef typename __conditional_type<include_hd, typelist_chain<Hd, rest>, rest>::__type type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_FILTER_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_flatten.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_FLATTEN_HPP
#define PB_DS_TYPELIST_FLATTEN_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Typelist_Chain>
struct typelist_chain_flatten_;
template<typename Hd_Tl>
struct typelist_chain_flatten_<typelist_chain<Hd_Tl, null_type> >
{
typedef typename Hd_Tl::root type;
};
template<typename Hd_Typelist, class Tl_Typelist>
struct typelist_chain_flatten_<typelist_chain<Hd_Typelist, Tl_Typelist> >
{
typedef typename typelist_chain_flatten_< Tl_Typelist>::type rest;
typedef typename typelist_append<Hd_Typelist, typelist<rest> >::type::root type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_FLATTEN_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_transform.hpp
* Contains typelist utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_TRANSFORM_HPP
#define PB_DS_TYPELIST_TRANSFORM_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Chain, template<typename T> class Transform>
struct typelist_chain_transform_;
template<template<typename T> class Transform>
struct typelist_chain_transform_<null_type, Transform>
{
typedef null_type type;
};
template<typename Hd, class Tl, template<typename T> class Transform>
struct typelist_chain_transform_<typelist_chain<Hd, Tl>, Transform>
{
typedef typename typelist_chain_transform_< Tl, Transform>::type rest;
typedef typename Transform<Hd>::type transform_type;
typedef typelist_chain<transform_type, rest> type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_TRANSFORM_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_typelist_append.hpp
* Contains typelist_chain utilities.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_TYPELIST_APPEND_HPP
#define PB_DS_TYPELIST_TYPELIST_APPEND_HPP
#include <ext/pb_ds/detail/type_utils.hpp>
namespace detail
{
template<typename Typelist_Typelist_Chain>
struct typelist_typelist_append_;
template<typename Hd>
struct typelist_typelist_append_<
typelist_chain<Hd, null_type> >
{
typedef typelist_chain< Hd, null_type> type;
};
template<typename Hd, class Tl>
struct typelist_typelist_append_<
typelist_chain<
Hd,
Tl> >
{
private:
typedef typename typelist_typelist_append_< Tl>::type rest;
public:
typedef
typename typelist_append<
Hd,
typelist<
rest> >::type::root
type;
};
} // namespace detail
#endif // #ifndef PB_DS_TYPELIST_TYPELIST_APPEND_HPP
// -*- C++ -*-
// Copyright (C) 2005, 2006 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 2, 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 COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// 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 typelist_assoc_container.hpp
* Contains an associative container based on typelists.
* Typelists are an idea by Andrei Alexandrescu.
*/
#ifndef PB_DS_TYPELIST_CHAIN_HPP
#define PB_DS_TYPELIST_CHAIN_HPP
#include <utility>
#include <ext/pb_ds/detail/typelist.hpp>
namespace pb_ds
{
namespace detail
{
template<typename Typelist = typelist<null_type> >
struct typelist_assoc_container
{
typedef Typelist tl;
};
template<typename Typelist_Assoc_Cntnr, typename Key, typename Data>
struct typelist_assoc_container_insert
{
private:
typedef typename Typelist_Assoc_Cntnr::tl already_tl;
typedef typelist<typelist_chain<std::pair<Key, Data>, null_type> > new_tl;
typedef typename typelist_append< new_tl, already_tl>::type so_happy_together;
public:
typedef typelist_assoc_container< so_happy_together> type;
};
#include <ext/pb_ds/detail/typelist/typelist_assoc_container_find.hpp>
template<typename Typelist_Assoc_Cntnr, typename Key>
struct typelist_assoc_container_find
{
private:
typedef typename Typelist_Assoc_Cntnr::tl already;
typedef typename already::root already_root;
};
} // namespace detail
} // namespace pb_ds
#endif // #ifndef PB_DS_TYPELIST_CHAIN_HPP
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#include <ext/pb_ds/exception.hpp> #include <ext/pb_ds/exception.hpp>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp> #include <ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp>
#include <ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp> #include <ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp>
#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp> #include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp>
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
* Typelists are an idea by Andrei Alexandrescu. * Typelists are an idea by Andrei Alexandrescu.
*/ */
#ifndef TYPELIST_HPP #ifndef _TYPELIST_H
#define TYPELIST_HPP 1 #define _TYPELIST_H 1
#include <ext/type_traits.h> #include <ext/type_traits.h>
...@@ -68,6 +68,10 @@ namespace typelist ...@@ -68,6 +68,10 @@ namespace typelist
typedef Typelist tail; typedef Typelist tail;
}; };
template<typename Fn, class Typelist>
void
apply(Fn&, Typelist);
template<typename Typelist0, typename Typelist1> template<typename Typelist0, typename Typelist1>
struct append; struct append;
...@@ -83,11 +87,33 @@ namespace typelist ...@@ -83,11 +87,33 @@ namespace typelist
template<typename Typelist, int i> template<typename Typelist, int i>
struct at_index; struct at_index;
template<typename Fn, typename Typelist>
struct apply;
template<typename Typelist, template<typename T> class Transform> template<typename Typelist, template<typename T> class Transform>
struct transform; struct transform;
template<typename Typelist_Typelist>
struct flatten;
template<typename Typelist>
struct from_first;
template<typename T1>
struct create1;
template<typename T1, typename T2>
struct create2;
template<typename T1, typename T2, typename T3>
struct create3;
template<typename T1, typename T2, typename T3, typename T4>
struct create4;
template<typename T1, typename T2, typename T3, typename T4, typename T5>
struct create5;
template<typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6>
struct create6;
} // namespace typelist } // namespace typelist
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -133,16 +159,50 @@ namespace detail ...@@ -133,16 +159,50 @@ namespace detail
template<typename Hd, typename Tl, typename Typelist_Chain> template<typename Hd, typename Tl, typename Typelist_Chain>
struct append_<chain<Hd, Tl>, Typelist_Chain> struct append_<chain<Hd, Tl>, Typelist_Chain>
{ {
typedef append_<Tl, Typelist_Chain> append_type; private:
typedef chain<Hd, typename append_type::type> type; typedef append_<Tl, Typelist_Chain> append_type;
public:
typedef chain<Hd, typename append_type::type> type;
}; };
template<typename Typelist_Chain> template<typename Typelist_Chain>
struct append_<null_type, Typelist_Chain> struct append_<null_type, Typelist_Chain>
{ {
typedef Typelist_Chain type;
};
template<typename Typelist_Chain>
struct append_<Typelist_Chain, null_type>
{
typedef Typelist_Chain type; typedef Typelist_Chain type;
}; };
template<>
struct append_<null_type, null_type>
{
typedef null_type type;
};
template<typename Typelist_Typelist_Chain>
struct append_typelist_;
template<typename Hd>
struct append_typelist_<chain<Hd, null_type> >
{
typedef chain<Hd, null_type> type;
};
template<typename Hd, typename Tl>
struct append_typelist_<chain< Hd, Tl> >
{
private:
typedef typename append_typelist_<Tl>::type rest_type;
public:
typedef typename append<Hd, node<rest_type> >::type::root type;
};
template<typename Typelist_Chain, typename T> template<typename Typelist_Chain, typename T>
struct contains_; struct contains_;
...@@ -179,19 +239,22 @@ namespace detail ...@@ -179,19 +239,22 @@ namespace detail
template<template<typename T> class Pred> template<template<typename T> class Pred>
struct chain_filter_<null_type, Pred> struct chain_filter_<null_type, Pred>
{ {
typedef null_type type; typedef null_type type;
}; };
template<typename Hd, typename Tl, template<typename T> class Pred> template<typename Hd, typename Tl, template<typename T> class Pred>
struct chain_filter_<chain<Hd, Tl>, Pred> struct chain_filter_<chain<Hd, Tl>, Pred>
{ {
private:
enum enum
{ {
include_hd = Pred<Hd>::value include_hd = Pred<Hd>::value
}; };
typedef typename chain_filter_<Tl, Pred>::type rest_type; typedef typename chain_filter_<Tl, Pred>::type rest_type;
typedef chain<Hd, rest_type> chain_type; typedef chain<Hd, rest_type> chain_type;
public:
typedef typename __conditional_type<include_hd, chain_type, rest_type>::__type type; typedef typename __conditional_type<include_hd, chain_type, rest_type>::__type type;
}; };
...@@ -207,7 +270,7 @@ namespace detail ...@@ -207,7 +270,7 @@ namespace detail
template<typename Hd, typename Tl, int i> template<typename Hd, typename Tl, int i>
struct chain_at_index_<chain<Hd, Tl>, i> struct chain_at_index_<chain<Hd, Tl>, i>
{ {
typedef typename chain_at_index_<Tl, i - 1>::type type; typedef typename chain_at_index_<Tl, i - 1>::type type;
}; };
template<class Typelist_Chain, template<typename T> class Transform> template<class Typelist_Chain, template<typename T> class Transform>
...@@ -216,56 +279,70 @@ namespace detail ...@@ -216,56 +279,70 @@ namespace detail
template<template<typename T> class Transform> template<template<typename T> class Transform>
struct chain_transform_<null_type, Transform> struct chain_transform_<null_type, Transform>
{ {
typedef null_type type; typedef null_type type;
}; };
template<class Hd, class Tl, template<typename T> class Transform> template<class Hd, class Tl, template<typename T> class Transform>
struct chain_transform_<chain<Hd, Tl>, Transform> struct chain_transform_<chain<Hd, Tl>, Transform>
{ {
typedef typename chain_transform_<Tl, Transform>::type rest_type; private:
typedef typename Transform<Hd>::type transform_type; typedef typename chain_transform_<Tl, Transform>::type rest_type;
typedef chain<transform_type, rest_type> type; typedef typename Transform<Hd>::type transform_type;
public:
typedef chain<transform_type, rest_type> type;
}; };
template<typename Typelist_Typelist_Chain> template<typename Typelist_Typelist_Chain>
struct append_typelist_; struct chain_flatten_;
template<typename Hd> template<typename Hd_Tl>
struct append_typelist_<chain<Hd, null_type> > struct chain_flatten_<chain<Hd_Tl, null_type> >
{ {
typedef chain<Hd, null_type> type; typedef typename Hd_Tl::root type;
}; };
template<typename Hd, typename Tl> template<typename Hd_Typelist, class Tl_Typelist>
struct append_typelist_<chain< Hd, Tl> > struct chain_flatten_<chain<Hd_Typelist, Tl_Typelist> >
{ {
private: private:
typedef typename append_typelist_<Tl>::type rest; typedef typename chain_flatten_<Tl_Typelist>::type rest_type;
typedef append<Hd_Typelist, node<rest_type> > append_type;
public: public:
typedef typename append<Hd, node<rest> >::type::root type; typedef typename append_type::type::root type;
}; };
} // namespace detail } // namespace detail
} // namespace typelist } // namespace typelist
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type>
#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) >
#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN2(X1, X2) >
#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN3(X1, X2, X3) >
#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN4(X1, X2, X3, X4) >
#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >
#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >
#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >
#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >
#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >
#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >
#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >
#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
namespace typelist namespace typelist
{ {
template<typename Fn, typename Typelist> template<typename Fn, class Typelist>
struct apply void
apply(Fn& fn, Typelist)
{ {
void detail::apply_<Fn, typename Typelist::root> a;
operator()(Fn& f) a(fn);
{ }
typedef typename Typelist::root root_type;
detail::apply_<Fn, root_type> a;
a(f);
}
};
template<typename Typelist0, typename Typelist1> template<typename Typelist0, typename Typelist1>
struct append struct append
...@@ -276,7 +353,7 @@ namespace typelist ...@@ -276,7 +353,7 @@ namespace typelist
typedef detail::append_<root0_type, root1_type> append_type; typedef detail::append_<root0_type, root1_type> append_type;
public: public:
typedef node<typename append_type::type> type; typedef node<typename append_type::type> type;
}; };
template<typename Typelist_Typelist> template<typename Typelist_Typelist>
...@@ -287,14 +364,16 @@ namespace typelist ...@@ -287,14 +364,16 @@ namespace typelist
typedef detail::append_typelist_<root_type> append_type; typedef detail::append_typelist_<root_type> append_type;
public: public:
typedef node<typename append_type::type> type; typedef node<typename append_type::type> type;
}; };
template<typename Typelist, typename T> template<typename Typelist, typename T>
struct contains struct contains
{ {
private:
typedef typename Typelist::root root_type; typedef typename Typelist::root root_type;
public:
enum enum
{ {
value = detail::contains_<root_type, T>::value value = detail::contains_<root_type, T>::value
...@@ -309,15 +388,17 @@ namespace typelist ...@@ -309,15 +388,17 @@ namespace typelist
typedef detail::chain_filter_<root_type, Pred> filter_type; typedef detail::chain_filter_<root_type, Pred> filter_type;
public: public:
typedef node<typename filter_type::type> type; typedef node<typename filter_type::type> type;
}; };
template<typename Typelist, int i> template<typename Typelist, int i>
struct at_index struct at_index
{ {
private:
typedef typename Typelist::root root_type; typedef typename Typelist::root root_type;
typedef detail::chain_at_index_<root_type, i> index_type; typedef detail::chain_at_index_<root_type, i> index_type;
public:
typedef typename index_type::type type; typedef typename index_type::type type;
}; };
...@@ -331,25 +412,68 @@ namespace typelist ...@@ -331,25 +412,68 @@ namespace typelist
public: public:
typedef node<typename transform_type::type> type; typedef node<typename transform_type::type> type;
}; };
template<typename Typelist_Typelist>
struct flatten
{
private:
typedef typename Typelist_Typelist::root root_type;
typedef typename detail::chain_flatten_<root_type>::type flatten_type;
public:
typedef node<flatten_type> type;
};
template<typename Typelist>
struct from_first
{
private:
typedef typename at_index<Typelist, 0>::type first_type;
public:
typedef node<chain<first_type, null_type> > type;
};
template<typename T1>
struct create1
{
typedef node<_GLIBCXX_TYPELIST_CHAIN1(T1)> type;
};
template<typename T1, typename T2>
struct create2
{
typedef node<_GLIBCXX_TYPELIST_CHAIN2(T1,T2)> type;
};
template<typename T1, typename T2, typename T3>
struct create3
{
typedef node<_GLIBCXX_TYPELIST_CHAIN3(T1,T2,T3)> type;
};
template<typename T1, typename T2, typename T3, typename T4>
struct create4
{
typedef node<_GLIBCXX_TYPELIST_CHAIN4(T1,T2,T3,T4)> type;
};
template<typename T1, typename T2, typename T3,
typename T4, typename T5>
struct create5
{
typedef node<_GLIBCXX_TYPELIST_CHAIN5(T1,T2,T3,T4,T5)> type;
};
template<typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6>
struct create6
{
typedef node<_GLIBCXX_TYPELIST_CHAIN6(T1,T2,T3,T4,T5,T6)> type;
};
} // namespace typelist } // namespace typelist
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type>
#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) >
#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN2(X1, X2) >
#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN3(X1, X2, X3) >
#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN4(X1, X2, X3, X4) >
#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >
#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >
#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >
#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >
#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >
#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >
#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >
#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
#endif #endif
...@@ -70,5 +70,5 @@ int main() ...@@ -70,5 +70,5 @@ int main()
h.resize(20); // { dg-error "instantiated from" } h.resize(20); // { dg-error "instantiated from" }
} }
// { dg-error "invalid" "" { target *-*-* } 236 } // { dg-error "invalid" "" { target *-*-* } 199 }
// { dg-excess-errors "member function" } // { dg-excess-errors "member function" }
...@@ -51,11 +51,9 @@ main() ...@@ -51,11 +51,9 @@ main()
#endif #endif
typedef __gnu_test::maps<int, thread_type>::type container_types; typedef __gnu_test::maps<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("create"); test_type test("create");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -61,11 +61,9 @@ main() ...@@ -61,11 +61,9 @@ main()
#endif #endif
typedef __gnu_test::sets<int, thread_type>::type container_types; typedef __gnu_test::sets<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("create_from_sorted"); test_type test("create_from_sorted");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -54,11 +54,9 @@ main() ...@@ -54,11 +54,9 @@ main()
#endif #endif
typedef __gnu_test::lists<int, thread_type>::type container_types; typedef __gnu_test::lists<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("create_sort"); test_type test("create_sort");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -57,11 +57,9 @@ main() ...@@ -57,11 +57,9 @@ main()
#endif #endif
typedef __gnu_test::maps<int, thread_type>::type container_types; typedef __gnu_test::maps<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("find"); test_type test("find");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -58,13 +58,10 @@ main() ...@@ -58,13 +58,10 @@ main()
#define thread_type true #define thread_type true
#endif #endif
using __gnu_test::associative_containers;
typedef __gnu_test::maps<int, thread_type>::type container_types; typedef __gnu_test::maps<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("index_associative"); test_type test("index_associative");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -65,8 +65,7 @@ main() ...@@ -65,8 +65,7 @@ main()
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("insert_associative"); test_type test("insert_associative");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -61,8 +61,7 @@ main() ...@@ -61,8 +61,7 @@ main()
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("insert_sequence"); test_type test("insert_sequence");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -68,8 +68,7 @@ main() ...@@ -68,8 +68,7 @@ main()
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("insert_erase_associative"); test_type test("insert_erase_associative");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -76,13 +76,10 @@ main() ...@@ -76,13 +76,10 @@ main()
#define thread_type true #define thread_type true
#endif #endif
using __gnu_test::associative_containers;
typedef __gnu_test::sets<int, thread_type>::type container_types; typedef __gnu_test::sets<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("insert_from_sorted"); test_type test("insert_from_sorted");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -250,8 +250,7 @@ main() ...@@ -250,8 +250,7 @@ main()
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("producer_consumer_associative"); test_type test("producer_consumer_associative");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -249,8 +249,7 @@ main() ...@@ -249,8 +249,7 @@ main()
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("producer_consumer_sequence"); test_type test("producer_consumer_sequence");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -71,13 +71,10 @@ main() ...@@ -71,13 +71,10 @@ main()
#define thread_type true #define thread_type true
#endif #endif
using __gnu_test::sequence_containers;
typedef __gnu_test::lists<int, thread_type>::type container_types; typedef __gnu_test::lists<int, thread_type>::type container_types;
typedef test_sequence<thread_type> test_type; typedef test_sequence<thread_type> test_type;
test_type test("sort_search"); test_type test("sort_search");
__gnu_cxx::typelist::apply<test_type, container_types> applier; __gnu_cxx::typelist::apply(test, container_types());
applier(test);
return 0; return 0;
} }
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for erasing random integers. * Contains test for erasing random integers.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/mem_usage/erase_test.hpp> #include <performance/assoc/mem_usage/erase_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <performance/mem/mem_track_allocator.hpp> #include <performance/mem/mem_track_allocator.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -94,7 +93,7 @@ main(int argc, char* a_p_argv[]) ...@@ -94,7 +93,7 @@ main(int argc, char* a_p_argv[])
tl_t; tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
...@@ -104,7 +103,7 @@ main(int argc, char* a_p_argv[]) ...@@ -104,7 +103,7 @@ main(int argc, char* a_p_argv[])
std::less<int>, alloc_t> std::less<int>, alloc_t>
native_t; native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,14 +44,13 @@ ...@@ -44,14 +44,13 @@
* Contains test for finding random integers. * Contains test for finding random integers.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_set.hpp> #include <native_type/assoc/native_hash_set.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/find_test.hpp> #include <performance/assoc/timing/find_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -87,13 +86,13 @@ main(int argc, char* a_p_argv[]) ...@@ -87,13 +86,13 @@ main(int argc, char* a_p_argv[])
test_t tst(b, b, vn, vs, vm, vn, vs, vm); test_t tst(b, b, vn, vs, vm, vn, vs, vm);
{ {
typedef native_hash_map< int, char> native_t; typedef native_hash_map< int, char> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef hash_common_types<int, char>::performance_tl tl_t; typedef hash_common_types<int, char>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for inserting text words. * Contains test for inserting text words.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_multimap.hpp> #include <native_type/assoc/native_hash_multimap.hpp>
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include <performance/assoc/timing/multimap_find_test.hpp> #include <performance/assoc/timing/multimap_find_test.hpp>
#include <performance/assoc/multimap_common_type.hpp> #include <performance/assoc/multimap_common_type.hpp>
#include <hash_fn/string_hash_fn.hpp> #include <hash_fn/string_hash_fn.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -101,21 +100,21 @@ main(int argc, char* a_p_argv[]) ...@@ -101,21 +100,21 @@ main(int argc, char* a_p_argv[])
typedef multimap_find_test<vec_t::const_iterator, false> test_type; typedef multimap_find_test<vec_t::const_iterator, false> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_hash_multimap<std::string, int, 8, string_hash_fn> native_t; typedef native_hash_multimap<std::string, int, 8, string_hash_fn> native_t;
typedef multimap_find_test<vec_t::const_iterator, true> test_type; typedef multimap_find_test<vec_t::const_iterator, true> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef native_multimap<std::string, int> native_t; typedef native_multimap<std::string, int> native_t;
typedef multimap_find_test<vec_t::const_iterator, true> test_type; typedef multimap_find_test<vec_t::const_iterator, true> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for inserting text words. * Contains test for inserting text words.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_multimap.hpp> #include <native_type/assoc/native_hash_multimap.hpp>
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/mem_usage/multimap_insert_test.hpp> #include <performance/assoc/mem_usage/multimap_insert_test.hpp>
#include <performance/assoc/multimap_common_type.hpp> #include <performance/assoc/multimap_common_type.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <performance/mem/mem_track_allocator.hpp> #include <performance/mem/mem_track_allocator.hpp>
#include <hash_fn/string_hash_fn.hpp> #include <hash_fn/string_hash_fn.hpp>
#include <iostream> #include <iostream>
...@@ -102,7 +101,7 @@ main(int argc, char* a_p_argv[]) ...@@ -102,7 +101,7 @@ main(int argc, char* a_p_argv[])
tl_t tl; tl_t tl;
typedef multimap_insert_test<vec_t::const_iterator, false> test_type; typedef multimap_insert_test<vec_t::const_iterator, false> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
...@@ -110,14 +109,14 @@ main(int argc, char* a_p_argv[]) ...@@ -110,14 +109,14 @@ main(int argc, char* a_p_argv[])
tl_t tl; tl_t tl;
typedef multimap_insert_test<vec_t::const_iterator, false> test_type; typedef multimap_insert_test<vec_t::const_iterator, false> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
typedef multimap_insert_test<vec_t::const_iterator, true> test_type; typedef multimap_insert_test<vec_t::const_iterator, true> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
{ {
typedef native_multimap<string_t, int, std::less<string_t>, alloc_t> native_t; typedef native_multimap<string_t, int, std::less<string_t>, alloc_t> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
...@@ -131,7 +130,7 @@ main(int argc, char* a_p_argv[]) ...@@ -131,7 +130,7 @@ main(int argc, char* a_p_argv[])
alloc_t> alloc_t>
native_t; native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for inserting text words. * Contains test for inserting text words.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_multimap.hpp> #include <native_type/assoc/native_hash_multimap.hpp>
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/multimap_insert_test.hpp> #include <performance/assoc/timing/multimap_insert_test.hpp>
#include <performance/assoc/multimap_common_type.hpp> #include <performance/assoc/multimap_common_type.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <hash_fn/string_hash_fn.hpp> #include <hash_fn/string_hash_fn.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -99,21 +98,21 @@ main(int argc, char* a_p_argv[]) ...@@ -99,21 +98,21 @@ main(int argc, char* a_p_argv[])
mmap_tl_tl tl; mmap_tl_tl tl;
typedef multimap_insert_test<vec_t::const_iterator, false> test_type; typedef multimap_insert_test<vec_t::const_iterator, false> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_hash_multimap<std::string, int, 8, string_hash_fn> native_t; typedef native_hash_multimap<std::string, int, 8, string_hash_fn> native_t;
typedef multimap_insert_test<vec_t::const_iterator, true> test_type; typedef multimap_insert_test<vec_t::const_iterator, true> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef native_multimap<std::string, int> native_t; typedef native_multimap<std::string, int> native_t;
typedef multimap_insert_test<vec_t::const_iterator, true> test_type; typedef multimap_insert_test<vec_t::const_iterator, true> test_type;
test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m); test_type tst(b, prm* ratio_n, prm* ratio_s, prm* ratio_m);
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,12 +44,11 @@ ...@@ -44,12 +44,11 @@
* Contains test for finding random_int. * Contains test for finding random_int.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/timing/push_pop_test.hpp> #include <performance/priority_queue/timing/push_pop_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <iostream> #include <iostream>
...@@ -84,17 +83,17 @@ main(int argc, char* a_p_argv[]) ...@@ -84,17 +83,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<int>::performance_tl pq_tl_t; typedef pq_common_types<int>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<int, true> native_pq_t; typedef native_priority_queue<int, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<int, false> native_pq_t; typedef native_priority_queue<int, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,12 +44,11 @@ ...@@ -44,12 +44,11 @@
* Contains test for finding random_int. * Contains test for finding random_int.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/timing/push_test.hpp> #include <performance/priority_queue/timing/push_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <iostream> #include <iostream>
...@@ -82,17 +81,17 @@ main(int argc, char* a_p_argv[]) ...@@ -82,17 +81,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<int>::performance_tl pq_tl_t; typedef pq_common_types<int>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<int, true> native_pq_t; typedef native_priority_queue<int, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<int, false> native_pq_t; typedef native_priority_queue<int, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
...@@ -101,17 +101,17 @@ main(int argc, char* a_p_argv[]) ...@@ -101,17 +101,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<std::string>::performance_tl pq_tl_t; typedef pq_common_types<std::string>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<std::string, true> native_pq_t; typedef native_priority_queue<std::string, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<std::string, false> native_pq_t; typedef native_priority_queue<std::string, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/timing/modify_test.hpp> #include <performance/priority_queue/timing/modify_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -88,17 +87,17 @@ main(int argc, char* a_p_argv[]) ...@@ -88,17 +87,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<std::string>::performance_tl pq_tl_t; typedef pq_common_types<std::string>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<std::string, true> native_pq_t; typedef native_priority_queue<std::string, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<std::string, false> native_pq_t; typedef native_priority_queue<std::string, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/mem_usage/pop_test.hpp> #include <performance/priority_queue/mem_usage/pop_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <performance/mem/mem_track_allocator.hpp> #include <performance/mem/mem_track_allocator.hpp>
#include <iostream> #include <iostream>
...@@ -84,17 +83,17 @@ main(int argc, char* a_p_argv[]) ...@@ -84,17 +83,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<string_t, std::less<string_t>, mem_track_allocator<char> >::performance_tl pq_tl_t; typedef pq_common_types<string_t, std::less<string_t>, mem_track_allocator<char> >::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<string_t, true, std::less<string_t>, mem_track_allocator<string_t> > native_pq_t; typedef native_priority_queue<string_t, true, std::less<string_t>, mem_track_allocator<string_t> > native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<string_t, false, std::less<string_t>, mem_track_allocator<string_t> > native_pq_t; typedef native_priority_queue<string_t, false, std::less<string_t>, mem_track_allocator<string_t> > native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/timing/push_pop_test.hpp> #include <performance/priority_queue/timing/push_pop_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -81,17 +80,17 @@ main(int argc, char* a_p_argv[]) ...@@ -81,17 +80,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<std::string>::performance_tl pq_tl_t; typedef pq_common_types<std::string>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<std::string, true> native_pq_t; typedef native_priority_queue<std::string, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<std::string, false> native_pq_t; typedef native_priority_queue<std::string, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/priority_queue/common_type.hpp> #include <common_type/priority_queue/common_type.hpp>
#include <performance/priority_queue/timing/push_test.hpp> #include <performance/priority_queue/timing/push_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/priority_queue/native_priority_queue.hpp> #include <native_type/priority_queue/native_priority_queue.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -81,17 +80,17 @@ main(int argc, char* a_p_argv[]) ...@@ -81,17 +80,17 @@ main(int argc, char* a_p_argv[])
{ {
typedef pq_common_types<std::string>::performance_tl pq_tl_t; typedef pq_common_types<std::string>::performance_tl pq_tl_t;
pq_tl_t tl; pq_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_priority_queue<std::string, true> native_pq_t; typedef native_priority_queue<std::string, true> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
{ {
typedef native_priority_queue<std::string, false> native_pq_t; typedef native_priority_queue<std::string, false> native_pq_t;
tst(pb_ds::detail::type_to_type<native_pq_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_pq_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for finding random integers. * Contains test for finding random integers.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_map.hpp> #include <native_type/assoc/native_hash_map.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/find_test.hpp> #include <performance/assoc/timing/find_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -83,24 +82,24 @@ main(int argc, char* a_p_argv[]) ...@@ -83,24 +82,24 @@ main(int argc, char* a_p_argv[])
test_t tst(b, b, vn, vs, vm, vn, vs, vm); test_t tst(b, b, vn, vs, vm, vn, vs, vm);
{ {
typedef native_hash_map< int, char> native_t; typedef native_hash_map< int, char> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef native_map< int, char> native_t; typedef native_map< int, char> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef hash_common_types<int, char>::performance_tl tl_t; typedef hash_common_types<int, char>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef tree_common_types<int, char>::performance_tl tl_t; typedef tree_common_types<int, char>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for subscripting random integers. * Contains test for subscripting random integers.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_map.hpp> #include <native_type/assoc/native_hash_map.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/subscript_find_test.hpp> #include <performance/assoc/timing/subscript_find_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -84,23 +83,23 @@ main(int argc, char* a_p_argv[]) ...@@ -84,23 +83,23 @@ main(int argc, char* a_p_argv[])
{ {
typedef hash_common_types<int, size_t>::performance_tl tl_t; typedef hash_common_types<int, size_t>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef tree_common_types<int, size_t>::performance_tl tl_t; typedef tree_common_types<int, size_t>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_hash_map<int, size_t> native_t; typedef native_hash_map<int, size_t> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef native_map< int, size_t> native_t; typedef native_map< int, size_t> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* Contains test for subscripting random integers. * Contains test for subscripting random integers.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <native_type/assoc/native_hash_map.hpp> #include <native_type/assoc/native_hash_map.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/subscript_insert_test.hpp> #include <performance/assoc/timing/subscript_insert_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -84,23 +83,23 @@ main(int argc, char* a_p_argv[]) ...@@ -84,23 +83,23 @@ main(int argc, char* a_p_argv[])
{ {
typedef hash_common_types<int, size_t>::performance_tl tl_t; typedef hash_common_types<int, size_t>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef tree_common_types<int, size_t>::performance_tl tl_t; typedef tree_common_types<int, size_t>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_hash_map< int, size_t> native_t; typedef native_hash_map< int, size_t> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
{ {
typedef native_map< int, size_t> native_t; typedef native_map< int, size_t> native_t;
tst(pb_ds::detail::type_to_type<native_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/find_test.hpp> #include <performance/assoc/timing/find_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <hash_fn/string_hash_fn.hpp> #include <hash_fn/string_hash_fn.hpp>
#include <native_type/assoc/native_hash_map.hpp> #include <native_type/assoc/native_hash_map.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
...@@ -86,22 +85,20 @@ main(int argc, char* a_p_argv[]) ...@@ -86,22 +85,20 @@ main(int argc, char* a_p_argv[])
typedef hash_common_types<std::string, char, string_hash_fn>::performance_tl hash_tl_t; typedef hash_common_types<std::string, char, string_hash_fn>::performance_tl hash_tl_t;
typedef pb_ds::detail::typelist_append<pat_trie_tl_t, pb_ds::detail::typelist_append<hash_tl_t, tree_tl_t>::type>::type tl_t; typedef __gnu_cxx::typelist::append<pat_trie_tl_t, __gnu_cxx::typelist::append<hash_tl_t, tree_tl_t>::type>::type tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_map<std::string, char> native_map_t; typedef native_map<std::string, char> native_map_t;
tst(pb_ds::detail::type_to_type<native_map_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_map_t>());
#ifdef PB_DS_USE_TR1
typedef native_hash_map<std::string, char, 8, string_hash_fn> native_hash_map_t; typedef native_hash_map<std::string, char, 8, string_hash_fn> native_hash_map_t;
tst(pb_ds::detail::type_to_type<native_hash_map_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_hash_map_t>());
// XXX Unfortunately, this crashes
#if 0
#ifdef PB_DS_USE_TR1
typedef typedef
native_hash_map< native_hash_map<
std::string, std::string,
...@@ -117,9 +114,8 @@ main(int argc, char* a_p_argv[]) ...@@ -117,9 +114,8 @@ main(int argc, char* a_p_argv[])
true> true>
sth_native_hash_map_t; sth_native_hash_map_t;
tst(pb_ds::detail::type_to_type<sth_native_hash_map_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<sth_native_hash_map_t>());
#endif // #ifdef PB_DS_USE_TR1 #endif
#endif // #if 0
} }
} }
catch(...) catch(...)
......
...@@ -46,12 +46,11 @@ ...@@ -46,12 +46,11 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <performance/assoc/timing/tree_order_statistics_test.hpp> #include <performance/assoc/timing/tree_order_statistics_test.hpp>
void void
...@@ -74,14 +73,14 @@ main(int argc, char* a_p_argv[]) ...@@ -74,14 +73,14 @@ main(int argc, char* a_p_argv[])
test_t tst(vn, vs, vm); test_t tst(vn, vs, vm);
typedef tree_common_types<int, pb_ds::null_mapped_type, std::less<int>, pb_ds::tree_order_statistics_node_update>::performance_tl tl_t; typedef tree_common_types<int, pb_ds::null_mapped_type, std::less<int>, pb_ds::tree_order_statistics_node_update>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef tree_order_statistics_test<false> test_t; typedef tree_order_statistics_test<false> test_t;
test_t tst(vn, vs, vm); test_t tst(vn, vs, vm);
typedef native_set<int> native_set_t; typedef native_set<int> native_set_t;
tst(pb_ds::detail::type_to_type<native_set_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_set_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for joining trees. * Contains test for joining trees.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <rng/twister_rand_gen.hpp> #include <rng/twister_rand_gen.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/tree_split_join_test.hpp> #include <performance/assoc/timing/tree_split_join_test.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -75,14 +74,14 @@ main(int argc, char* a_p_argv[]) ...@@ -75,14 +74,14 @@ main(int argc, char* a_p_argv[])
typedef tree_common_types<int, pb_ds::null_mapped_type>::performance_tl tl_t; typedef tree_common_types<int, pb_ds::null_mapped_type>::performance_tl tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef tree_split_join_test<false> test_t; typedef tree_split_join_test<false> test_t;
test_t tst(vn, vs, vm); test_t tst(vn, vs, vm);
typedef native_set<int> native_set_t; typedef native_set<int> native_set_t;
tst(pb_ds::detail::type_to_type<native_set_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_set_t>());
} }
} }
catch(...) catch(...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text. * Contains test for finding text.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/insert_test.hpp> #include <performance/assoc/timing/insert_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <hash_fn/string_hash_fn.hpp> #include <hash_fn/string_hash_fn.hpp>
#include <native_type/assoc/native_hash_map.hpp> #include <native_type/assoc/native_hash_map.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
...@@ -83,14 +82,14 @@ main(int argc, char* a_p_argv[]) ...@@ -83,14 +82,14 @@ main(int argc, char* a_p_argv[])
{ {
typedef trie_common_types<std::string, char>::performance_tl pat_trie_tl_t; typedef trie_common_types<std::string, char>::performance_tl pat_trie_tl_t;
typedef tree_common_types<std::string, char>::performance_tl tree_tl_t; typedef tree_common_types<std::string, char>::performance_tl tree_tl_t;
typedef pb_ds::detail::typelist_append<pat_trie_tl_t, tree_tl_t>::type tl_t; typedef __gnu_cxx::typelist::append<pat_trie_tl_t, tree_tl_t>::type tl_t;
tl_t tl; tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
{ {
typedef native_map<std::string, char> native_map_t; typedef native_map<std::string, char> native_map_t;
tst(pb_ds::detail::type_to_type<native_map_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_map_t>());
} }
} }
catch (...) catch (...)
......
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
* Contains test for finding text with locality of reference. * Contains test for finding text with locality of reference.
*/ */
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <performance/io/xml_formatter.hpp> #include <performance/io/xml_formatter.hpp>
#include <io/verified_cmd_line_input.hpp> #include <io/verified_cmd_line_input.hpp>
#include <common_type/assoc/common_type.hpp> #include <common_type/assoc/common_type.hpp>
#include <performance/assoc/timing/find_test.hpp> #include <performance/assoc/timing/find_test.hpp>
#include <io/text_populate.hpp> #include <io/text_populate.hpp>
#include <ext/pb_ds/detail/typelist.hpp>
#include <native_type/assoc/native_map.hpp> #include <native_type/assoc/native_map.hpp>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
...@@ -81,13 +80,13 @@ main(int argc, char* a_p_argv[]) ...@@ -81,13 +80,13 @@ main(int argc, char* a_p_argv[])
test_t tst(b, b, vn, vs, vm, vn, vs, vm); test_t tst(b, b, vn, vs, vm, vn, vs, vm);
{ {
typedef native_map<std::string, char> native_set_t; typedef native_map<std::string, char> native_set_t;
tst(pb_ds::detail::type_to_type<native_set_t>()); tst(__gnu_cxx::typelist::detail::type_to_type<native_set_t>());
} }
{ {
typedef tree_common_types<std::string, char>::performance_tl tree_tl_t; typedef tree_common_types<std::string, char>::performance_tl tree_tl_t;
tree_tl_t tl; tree_tl_t tl;
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
} }
catch(...) catch(...)
......
...@@ -65,7 +65,7 @@ namespace pb_ds ...@@ -65,7 +65,7 @@ namespace pb_ds
class Eq_Fn = class Eq_Fn =
std::equal_to<Key>, std::equal_to<Key>,
class Allocator = class Allocator =
std::allocator< std::pair<const Key, Data> > > std::allocator<std::pair<const Key, Data> > >
struct hash_common_types struct hash_common_types
{ {
private: private:
...@@ -109,12 +109,12 @@ namespace pb_ds ...@@ -109,12 +109,12 @@ namespace pb_ds
true> true>
access_half_max_col_check_check_resize_trigger_policy; access_half_max_col_check_check_resize_trigger_policy;
typedef pb_ds::test::linear_probe_fn_t_< Key, Allocator> lin_p_t; typedef pb_ds::test::linear_probe_fn_t_<Key, Allocator> lin_p_t;
typedef pb_ds::test::quadratic_probe_fn_t_< Key, Allocator> quad_p_t; typedef pb_ds::test::quadratic_probe_fn_t_<Key, Allocator> quad_p_t;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -124,7 +124,7 @@ namespace pb_ds ...@@ -124,7 +124,7 @@ namespace pb_ds
performance_cc_policy0; performance_cc_policy0;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mod_range_hashing_t_< pb_ds::test::direct_mod_range_hashing_t_<
Allocator>, Allocator>,
...@@ -133,7 +133,7 @@ namespace pb_ds ...@@ -133,7 +133,7 @@ namespace pb_ds
performance_cc_policy1; performance_cc_policy1;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -143,7 +143,7 @@ namespace pb_ds ...@@ -143,7 +143,7 @@ namespace pb_ds
performance_cc_policy2; performance_cc_policy2;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mod_range_hashing_t_< pb_ds::test::direct_mod_range_hashing_t_<
Allocator>, Allocator>,
...@@ -152,7 +152,7 @@ namespace pb_ds ...@@ -152,7 +152,7 @@ namespace pb_ds
performance_cc_policy3; performance_cc_policy3;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::true_type, pb_ds::detail::true_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -162,7 +162,7 @@ namespace pb_ds ...@@ -162,7 +162,7 @@ namespace pb_ds
performance_cc_policy4; performance_cc_policy4;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -172,7 +172,7 @@ namespace pb_ds ...@@ -172,7 +172,7 @@ namespace pb_ds
performance_cc_policy5; performance_cc_policy5;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -182,7 +182,7 @@ namespace pb_ds ...@@ -182,7 +182,7 @@ namespace pb_ds
regression_cc_policy0; regression_cc_policy0;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::false_type, pb_ds::detail::false_type,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
Allocator>, Allocator>,
...@@ -192,7 +192,7 @@ namespace pb_ds ...@@ -192,7 +192,7 @@ namespace pb_ds
regression_cc_policy1; regression_cc_policy1;
typedef typedef
typename pb_ds::detail::typelist4< typename __gnu_cxx::typelist::create4<
pb_ds::detail::true_type, pb_ds::detail::true_type,
pb_ds::test::direct_mod_range_hashing_t_< pb_ds::test::direct_mod_range_hashing_t_<
Allocator>, Allocator>,
...@@ -201,7 +201,7 @@ namespace pb_ds ...@@ -201,7 +201,7 @@ namespace pb_ds
regression_cc_policy2; regression_cc_policy2;
typedef typedef
typename pb_ds::detail::typelist5< typename __gnu_cxx::typelist::create5<
pb_ds::detail::false_type, pb_ds::detail::false_type,
lin_p_t, lin_p_t,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
...@@ -212,7 +212,7 @@ namespace pb_ds ...@@ -212,7 +212,7 @@ namespace pb_ds
performance_gp_policy0; performance_gp_policy0;
typedef typedef
typename pb_ds::detail::typelist5< typename __gnu_cxx::typelist::create5<
pb_ds::detail::false_type, pb_ds::detail::false_type,
quad_p_t, quad_p_t,
pb_ds::test::direct_mod_range_hashing_t_< pb_ds::test::direct_mod_range_hashing_t_<
...@@ -222,7 +222,7 @@ namespace pb_ds ...@@ -222,7 +222,7 @@ namespace pb_ds
performance_gp_policy1; performance_gp_policy1;
typedef typedef
typename pb_ds::detail::typelist5< typename __gnu_cxx::typelist::create5<
pb_ds::detail::false_type, pb_ds::detail::false_type,
quad_p_t, quad_p_t,
pb_ds::test::direct_mod_range_hashing_t_< pb_ds::test::direct_mod_range_hashing_t_<
...@@ -232,7 +232,7 @@ namespace pb_ds ...@@ -232,7 +232,7 @@ namespace pb_ds
regression_gp_policy0; regression_gp_policy0;
typedef typedef
typename pb_ds::detail::typelist5< typename __gnu_cxx::typelist::create5<
pb_ds::detail::true_type, pb_ds::detail::true_type,
lin_p_t, lin_p_t,
pb_ds::test::direct_mask_range_hashing_t_< pb_ds::test::direct_mask_range_hashing_t_<
...@@ -243,7 +243,7 @@ namespace pb_ds ...@@ -243,7 +243,7 @@ namespace pb_ds
regression_gp_policy1; regression_gp_policy1;
typedef typedef
typename pb_ds::detail::typelist6< typename __gnu_cxx::typelist::create6<
performance_cc_policy0, performance_cc_policy0,
performance_cc_policy1, performance_cc_policy1,
performance_cc_policy2, performance_cc_policy2,
...@@ -253,20 +253,20 @@ namespace pb_ds ...@@ -253,20 +253,20 @@ namespace pb_ds
performance_cc_range_hashing_policies; performance_cc_range_hashing_policies;
typedef typedef
typename pb_ds::detail::typelist3< typename __gnu_cxx::typelist::create3<
regression_cc_policy0, regression_cc_policy0,
regression_cc_policy1, regression_cc_policy1,
regression_cc_policy2>::type regression_cc_policy2>::type
regression_cc_range_hashing_policies; regression_cc_range_hashing_policies;
typedef typedef
typename pb_ds::detail::typelist2< typename __gnu_cxx::typelist::create2<
performance_gp_policy0, performance_gp_policy0,
performance_gp_policy1>::type performance_gp_policy1>::type
performance_gp_range_hashing_policies; performance_gp_range_hashing_policies;
typedef typedef
typename pb_ds::detail::typelist2< typename __gnu_cxx::typelist::create2<
regression_gp_policy0, regression_gp_policy0,
regression_gp_policy1>::type regression_gp_policy1>::type
regression_gp_range_hashing_policies; regression_gp_range_hashing_policies;
...@@ -276,7 +276,7 @@ namespace pb_ds ...@@ -276,7 +276,7 @@ namespace pb_ds
{ {
private: private:
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 0>::type Policy_Tl, 0>::type
store_hash_indicator; store_hash_indicator;
...@@ -286,17 +286,17 @@ namespace pb_ds ...@@ -286,17 +286,17 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 1>::type Policy_Tl, 1>::type
comb_hash_fn; comb_hash_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 2>::type Policy_Tl, 2>::type
trigger_policy; trigger_policy;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 3>::type Policy_Tl, 3>::type
size_policy; size_policy;
...@@ -322,7 +322,7 @@ namespace pb_ds ...@@ -322,7 +322,7 @@ namespace pb_ds
{ {
private: private:
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 0>::type Policy_Tl, 0>::type
store_hash_indicator; store_hash_indicator;
...@@ -332,17 +332,17 @@ namespace pb_ds ...@@ -332,17 +332,17 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 1>::type Policy_Tl, 1>::type
comb_hash_fn; comb_hash_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 2>::type Policy_Tl, 2>::type
trigger_policy; trigger_policy;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 3>::type Policy_Tl, 3>::type
size_policy; size_policy;
...@@ -368,7 +368,7 @@ namespace pb_ds ...@@ -368,7 +368,7 @@ namespace pb_ds
{ {
private: private:
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 0>::type Policy_Tl, 0>::type
store_hash_indicator; store_hash_indicator;
...@@ -378,22 +378,22 @@ namespace pb_ds ...@@ -378,22 +378,22 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 1>::type Policy_Tl, 1>::type
probe_fn; probe_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 2>::type Policy_Tl, 2>::type
comb_probe_fn; comb_probe_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 3>::type Policy_Tl, 3>::type
trigger_policy; trigger_policy;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 4>::type Policy_Tl, 4>::type
size_policy; size_policy;
...@@ -420,7 +420,7 @@ namespace pb_ds ...@@ -420,7 +420,7 @@ namespace pb_ds
{ {
private: private:
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 0>::type Policy_Tl, 0>::type
store_hash_indicator; store_hash_indicator;
...@@ -430,22 +430,22 @@ namespace pb_ds ...@@ -430,22 +430,22 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 1>::type Policy_Tl, 1>::type
probe_fn; probe_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 2>::type Policy_Tl, 2>::type
comb_probe_fn; comb_probe_fn;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 3>::type Policy_Tl, 3>::type
trigger_policy; trigger_policy;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 4>::type Policy_Tl, 4>::type
size_policy; size_policy;
...@@ -468,56 +468,56 @@ namespace pb_ds ...@@ -468,56 +468,56 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
performance_cc_range_hashing_policies, performance_cc_range_hashing_policies,
no_access_generic_cc_hash_table_t>::type no_access_generic_cc_hash_table_t>::type
performance_cc_types; performance_cc_types;
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
regression_cc_range_hashing_policies, regression_cc_range_hashing_policies,
access_generic_cc_hash_table_t>::type access_generic_cc_hash_table_t>::type
regression_cc_types; regression_cc_types;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
performance_cc_types, performance_cc_types,
0>::type 0>::type
performance_min_cc_type; performance_min_cc_type;
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
performance_gp_range_hashing_policies, performance_gp_range_hashing_policies,
no_access_generic_gp_hash_table_t>::type no_access_generic_gp_hash_table_t>::type
performance_gp_types; performance_gp_types;
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
regression_gp_range_hashing_policies, regression_gp_range_hashing_policies,
access_generic_gp_hash_table_t>::type access_generic_gp_hash_table_t>::type
regression_gp_types; regression_gp_types;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
performance_gp_types, performance_gp_types,
0>::type 0>::type
performance_min_gp_type; performance_min_gp_type;
public: public:
typedef typedef
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
performance_cc_types, performance_cc_types,
performance_gp_types>::type performance_gp_types>::type
performance_tl; performance_tl;
typedef typedef
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
regression_gp_types, regression_gp_types,
regression_cc_types>::type regression_cc_types>::type
regression_tl; regression_tl;
typedef typedef
typename pb_ds::detail::typelist1< typename __gnu_cxx::typelist::create1<
performance_min_cc_type>::type performance_min_cc_type>::type
performance_min_tl; performance_min_tl;
}; };
...@@ -636,7 +636,7 @@ namespace pb_ds ...@@ -636,7 +636,7 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
Comb_Hash_Fn_TL, Comb_Hash_Fn_TL,
generic_cc_hash_table_t>::type generic_cc_hash_table_t>::type
performance_cc_types; performance_cc_types;
...@@ -660,14 +660,14 @@ namespace pb_ds ...@@ -660,14 +660,14 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
Comb_Probe_Fn_TL, Comb_Probe_Fn_TL,
no_access_generic_gp_hash_table_t>::type no_access_generic_gp_hash_table_t>::type
performance_gp_types; performance_gp_types;
public: public:
typedef typedef
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
performance_cc_types, performance_cc_types,
performance_gp_types>::type performance_gp_types>::type
performance_tl; performance_tl;
...@@ -683,14 +683,14 @@ namespace pb_ds ...@@ -683,14 +683,14 @@ namespace pb_ds
typedef pb_ds::test::move_to_front_lu_policy_t_ mtf_u; typedef pb_ds::test::move_to_front_lu_policy_t_ mtf_u;
typedef pb_ds::test::counter_lu_policy_t_< Allocator, 5> cnt_5_u; typedef pb_ds::test::counter_lu_policy_t_<Allocator, 5> cnt_5_u;
typedef typename pb_ds::detail::typelist1< mtf_u>::type lu_policy0; typedef typename __gnu_cxx::typelist::create1<mtf_u>::type lu_policy0;
typedef typename pb_ds::detail::typelist1< cnt_5_u>::type lu_policy1; typedef typename __gnu_cxx::typelist::create1<cnt_5_u>::type lu_policy1;
typedef typedef
typename pb_ds::detail::typelist2< typename __gnu_cxx::typelist::create2<
lu_policy0, lu_policy0,
lu_policy1>::type lu_policy1>::type
lu_policies; lu_policies;
...@@ -700,7 +700,7 @@ namespace pb_ds ...@@ -700,7 +700,7 @@ namespace pb_ds
{ {
private: private:
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
Policy_Tl, 0>::type Policy_Tl, 0>::type
update_policy_t; update_policy_t;
...@@ -716,26 +716,22 @@ namespace pb_ds ...@@ -716,26 +716,22 @@ namespace pb_ds
}; };
typedef typedef
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
lu_policies, lu_policies,
generic_list_update_t>::type generic_list_update_t>::type
lu_types; lu_types;
typedef typedef
typename pb_ds::detail::typelist_at_index< typename __gnu_cxx::typelist::at_index<
lu_types, lu_types,
0>::type 0>::type
min_lu_type; min_lu_type;
public: public:
typedef lu_types performance_tl; typedef lu_types performance_tl;
typedef lu_types regression_tl; typedef lu_types regression_tl;
typedef typedef typename __gnu_cxx::typelist::create1<min_lu_type>::type performance_min_tl;
typename pb_ds::detail::typelist1<
min_lu_type>::type
performance_min_tl;
}; };
template<typename Key, typename Data, class Cmp_Fn = std::less<Key>, template<typename Key, typename Data, class Cmp_Fn = std::less<Key>,
...@@ -743,10 +739,8 @@ namespace pb_ds ...@@ -743,10 +739,8 @@ namespace pb_ds
class Node_Iterator, class Node_Iterator,
class Cmp_Fn_, class Cmp_Fn_,
class Allocator_> class Allocator_>
class Node_Update = class Node_Update = pb_ds::null_tree_node_update,
pb_ds::null_tree_node_update, class Allocator = std::allocator<std::pair<const Key, Data> > >
class Allocator =
std::allocator<std::pair<const Key, Data> > >
struct tree_common_types struct tree_common_types
{ {
private: private:
...@@ -782,21 +776,21 @@ namespace pb_ds ...@@ -782,21 +776,21 @@ namespace pb_ds
public: public:
typedef typedef
typename pb_ds::detail::typelist3< typename __gnu_cxx::typelist::create3<
splay_tree_assoc_container_t, splay_tree_assoc_container_t,
rb_tree_assoc_container_t, rb_tree_assoc_container_t,
ov_tree_assoc_container_t>::type ov_tree_assoc_container_t>::type
performance_tl; performance_tl;
typedef typedef
typename pb_ds::detail::typelist3< typename __gnu_cxx::typelist::create3<
ov_tree_assoc_container_t, ov_tree_assoc_container_t,
splay_tree_assoc_container_t, splay_tree_assoc_container_t,
rb_tree_assoc_container_t>::type rb_tree_assoc_container_t>::type
regression_tl; regression_tl;
typedef typedef
typename pb_ds::detail::typelist1< typename __gnu_cxx::typelist::create1<
rb_tree_assoc_container_t>::type rb_tree_assoc_container_t>::type
performance_min_tl; performance_min_tl;
}; };
...@@ -804,40 +798,23 @@ namespace pb_ds ...@@ -804,40 +798,23 @@ namespace pb_ds
template<typename Key, template<typename Key,
typename Data, typename Data,
class E_Access_Traits = class E_Access_Traits =
typename pb_ds::detail::default_trie_e_access_traits< typename pb_ds::detail::default_trie_e_access_traits<Key>::type,
Key>::type, class Tag = pb_ds::pat_trie_tag,
class Tag =
pb_ds::pat_trie_tag,
template<typename Const_Node_Iterator, template<typename Const_Node_Iterator,
typename Node_Iterator, typename Node_Iterator,
class E_Access_Traits_, class E_Access_Traits_,
typename Allocator_> typename Allocator_>
class Node_Update = class Node_Update = pb_ds::null_trie_node_update,
pb_ds::null_trie_node_update, class Allocator = std::allocator<char> >
class Allocator =
std::allocator<char> >
class trie_common_types class trie_common_types
{ {
private: private:
typedef typedef pb_ds::trie<Key, Data, E_Access_Traits, Tag, Node_Update, Allocator> type;
pb_ds::trie<
Key,
Data,
E_Access_Traits,
Tag,
Node_Update,
Allocator>
type;
public: public:
typedef typename pb_ds::detail::typelist1< type>::type performance_tl; typedef typename __gnu_cxx::typelist::create1<type>::type performance_tl;
typedef typename __gnu_cxx::typelist::create1<type>::type regression_tl;
typedef typename pb_ds::detail::typelist1< type>::type regression_tl; typedef typename __gnu_cxx::typelist::create1<type>::type performance_min_tl;
typedef
typename pb_ds::detail::typelist1<
type>::type
performance_min_tl;
}; };
} // namespace test } // namespace test
......
...@@ -81,74 +81,74 @@ namespace pb_ds ...@@ -81,74 +81,74 @@ namespace pb_ds
private: private:
template<typename D_Cntnr> template<typename D_Cntnr>
static std::string static std::string
name(pb_ds::detail::type_to_type<D_Cntnr>) name(__gnu_cxx::typelist::detail::type_to_type<D_Cntnr>)
{ {
return ("mmap_" + pb_ds_string_form<D_Cntnr>::name()); return ("mmap_" + pb_ds_string_form<D_Cntnr>::name());
} }
template<typename D_Cntnr> template<typename D_Cntnr>
static std::string static std::string
desc(pb_ds::detail::type_to_type<D_Cntnr>) desc(__gnu_cxx::typelist::detail::type_to_type<D_Cntnr>)
{ {
return (pb_ds_string_form<D_Cntnr>::desc()); return (pb_ds_string_form<D_Cntnr>::desc());
} }
static std::string static std::string
name(pb_ds::detail::type_to_type<size_t>) name(__gnu_cxx::typelist::detail::type_to_type<size_t>)
{ {
return ("map"); return ("map");
} }
static std::string static std::string
desc(pb_ds::detail::type_to_type<size_t>) desc(__gnu_cxx::typelist::detail::type_to_type<size_t>)
{ {
return (""); return ("");
} }
static std::string static std::string
name(pb_ds::detail::type_to_type<basic_type>) name(__gnu_cxx::typelist::detail::type_to_type<basic_type>)
{ {
return ("map"); return ("map");
} }
static std::string static std::string
desc(pb_ds::detail::type_to_type<basic_type>) desc(__gnu_cxx::typelist::detail::type_to_type<basic_type>)
{ {
return (""); return ("");
} }
static std::string static std::string
name(pb_ds::detail::type_to_type<int>) name(__gnu_cxx::typelist::detail::type_to_type<int>)
{ {
return ("map"); return ("map");
} }
static std::string static std::string
desc(pb_ds::detail::type_to_type<int>) desc(__gnu_cxx::typelist::detail::type_to_type<int>)
{ {
return (""); return ("");
} }
static std::string static std::string
name(pb_ds::detail::type_to_type<char>) name(__gnu_cxx::typelist::detail::type_to_type<char>)
{ {
return ("map"); return ("map");
} }
static std::string static std::string
desc(pb_ds::detail::type_to_type<char>) desc(__gnu_cxx::typelist::detail::type_to_type<char>)
{ {
return (""); return ("");
} }
static std::string static std::string
name(pb_ds::detail::type_to_type<pb_ds::null_mapped_type>) name(__gnu_cxx::typelist::detail::type_to_type<pb_ds::null_mapped_type>)
{ {
return ("set"); return ("set");
} }
static std::string static std::string
desc(pb_ds::detail::type_to_type<pb_ds::null_mapped_type>) desc(__gnu_cxx::typelist::detail::type_to_type<pb_ds::null_mapped_type>)
{ {
return (""); return ("");
} }
...@@ -157,13 +157,13 @@ namespace pb_ds ...@@ -157,13 +157,13 @@ namespace pb_ds
static std::string static std::string
name() name()
{ {
return (name(pb_ds::detail::type_to_type<mapped_type>())); return (name(__gnu_cxx::typelist::detail::type_to_type<mapped_type>()));
} }
static std::string static std::string
desc() desc()
{ {
return (desc(pb_ds::detail::type_to_type<mapped_type>())); return (desc(__gnu_cxx::typelist::detail::type_to_type<mapped_type>()));
} }
}; };
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
#ifndef PB_DS_TEMPLATE_POLICY_HPP #ifndef PB_DS_TEMPLATE_POLICY_HPP
#define PB_DS_TEMPLATE_POLICY_HPP #define PB_DS_TEMPLATE_POLICY_HPP
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
#include <ext/pb_ds/hash_policy.hpp> #include <ext/pb_ds/hash_policy.hpp>
#include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/list_update_policy.hpp> #include <ext/pb_ds/list_update_policy.hpp>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <ext/pb_ds/detail/type_utils.hpp> #include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/priority_queue.hpp> #include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/detail/typelist.hpp> #include <ext/typelist.h>
namespace pb_ds namespace pb_ds
{ {
...@@ -72,7 +72,7 @@ namespace pb_ds ...@@ -72,7 +72,7 @@ namespace pb_ds
typedef pb_ds::priority_queue<Value_Type, Cmp_Fn, pb_ds::thin_heap_tag, Allocator> thin_heap_t; typedef pb_ds::priority_queue<Value_Type, Cmp_Fn, pb_ds::thin_heap_tag, Allocator> thin_heap_t;
typedef typename pb_ds::detail::typelist5<thin_heap_t, pairing_heap_t, binomial_heap_t, rc_binomial_heap_t, binary_heap_t>::type all_tl; 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: public:
typedef all_tl performance_tl; typedef all_tl performance_tl;
......
...@@ -47,10 +47,11 @@ ...@@ -47,10 +47,11 @@
#ifndef PB_DS_NATIVE_HASH_MAP_HPP #ifndef PB_DS_NATIVE_HASH_MAP_HPP
#define PB_DS_NATIVE_HASH_MAP_HPP #define PB_DS_NATIVE_HASH_MAP_HPP
#include <string>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <native_type/assoc/native_hash_tag.hpp> #include <native_type/assoc/native_hash_tag.hpp>
#include <io/xml.hpp> #include <io/xml.hpp>
#include <string>
// Default to using tr1. // Default to using tr1.
#define PB_DS_USE_TR1 1 #define PB_DS_USE_TR1 1
......
...@@ -47,57 +47,27 @@ ...@@ -47,57 +47,27 @@
#ifndef PB_DS_NATIVE_HASH_MULTIMAP_HPP #ifndef PB_DS_NATIVE_HASH_MULTIMAP_HPP
#define PB_DS_NATIVE_HASH_MULTIMAP_HPP #define PB_DS_NATIVE_HASH_MULTIMAP_HPP
#include <string>
#include <ext/hash_map>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <native_type/assoc/native_hash_tag.hpp> #include <native_type/assoc/native_hash_tag.hpp>
#include <io/xml.hpp> #include <io/xml.hpp>
#include <string>
#include <ext/hash_map>
namespace pb_ds namespace pb_ds
{ {
namespace test namespace test
{ {
#define PB_DS_BASE_C_DEC \
#define PB_DS_CLASS_T_DEC \ __gnu_cxx::hash_multimap<Key, Data, Hash_Fn, Eq_Fn, Allocator>
template< \
typename Key, \
typename Data, \
size_t Init_Size, \
class Hash_Fn, \
class Eq_Fn, \
class Less_Fn, \
class Allocator>
#define PB_DS_CLASS_C_DEC \
native_hash_multimap< \
Key, \
Data, \
Init_Size, \
Hash_Fn, \
Eq_Fn, \
Less_Fn, \
Allocator>
#define PB_DS_BASE_C_DEC \
__gnu_cxx::hash_multimap< \
Key, \
Data, \
Hash_Fn, \
Eq_Fn, \
Allocator>
template<typename Key, template<typename Key,
typename Data, typename Data,
size_t Init_Size = 8, size_t Init_Size = 8,
class Hash_Fn = class Hash_Fn = typename pb_ds::detail::default_hash_fn<Key>::type,
typename pb_ds::detail::default_hash_fn<Key>::type, class Eq_Fn = std::equal_to<Key>,
class Eq_Fn = class Less_Fn = std::less<Key>,
std::equal_to<Key>, class Allocator = std::allocator<char> >
class Less_Fn =
std::less<Key>,
class Allocator =
std::allocator<char> >
class native_hash_multimap : public PB_DS_BASE_C_DEC class native_hash_multimap : public PB_DS_BASE_C_DEC
{ {
private: private:
...@@ -114,119 +84,78 @@ namespace pb_ds ...@@ -114,119 +84,78 @@ namespace pb_ds
typedef typedef
typename Allocator::template rebind< typename Allocator::template rebind<
std::pair< std::pair<Key, Data> >::other::const_reference
Key,
Data> >::other::const_reference
const_reference; const_reference;
public: native_hash_multimap() : base_type(Init_Size)
native_hash_multimap(); { }
template<typename It>
native_hash_multimap(It f, It l) : base_type(f, l)
{ }
inline void inline void
insert(typename base_type::const_reference r_val) insert(typename base_type::const_reference r_val)
{ {
typedef typedef std::pair<iterator, iterator> eq_range_t;
std::pair<
typename base_type::iterator,
typename base_type::iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::iterator it = f.first; iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
return; return;
++it; ++it;
} }
base_type::insert(r_val); base_type::insert(r_val);
} }
inline iterator inline iterator
find(const_reference r_val) find(const_reference r_val)
{ {
typedef typedef std::pair<iterator, iterator> eq_range_t;
std::pair<
typename base_type::iterator,
typename base_type::iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::iterator it = f.first; iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
return it; return it;
++it; ++it;
} }
return base_type::end(); return base_type::end();
} }
inline const_iterator inline const_iterator
find(const_reference r_val) const find(const_reference r_val) const
{ {
typedef typedef std::pair<const_iterator, const_iterator> eq_range_t;
std::pair<
typename base_type::const_iterator,
typename base_type::const_iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::const_iterator it = f.first; const_iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
return it; return it;
++it; ++it;
} }
return base_type::end(); return base_type::end();
} }
template<typename It>
native_hash_multimap(It f, It l);
static std::string static std::string
name() name()
{ { return std::string("n_hash_mmap"); }
return ("n_hash_mmap");
}
static std::string static std::string
desc() desc()
{ {
return (make_xml_tag("type", "value", "__gnucxx_hash_multimap")); return make_xml_tag("type", "value", "__gnucxx_hash_multimap");
} }
}; };
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
native_hash_multimap() : base_type(Init_Size)
{ }
PB_DS_CLASS_T_DEC
template<typename It>
PB_DS_CLASS_C_DEC::
native_hash_multimap(It f, It l) : base_type(f, l)
{ }
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
} // namespace test } // namespace test
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_NATIVE_HASH_MULTIMAP_HPP #endif
...@@ -47,10 +47,11 @@ ...@@ -47,10 +47,11 @@
#ifndef PB_DS_NATIVE_HASH_SET_HPP #ifndef PB_DS_NATIVE_HASH_SET_HPP
#define PB_DS_NATIVE_HASH_SET_HPP #define PB_DS_NATIVE_HASH_SET_HPP
#include <string>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <native_type/assoc/native_hash_tag.hpp> #include <native_type/assoc/native_hash_tag.hpp>
#include <io/xml.hpp> #include <io/xml.hpp>
#include <string>
// Default to using tr1. // Default to using tr1.
#define PB_DS_USE_TR1 1 #define PB_DS_USE_TR1 1
...@@ -77,7 +78,7 @@ namespace pb_ds ...@@ -77,7 +78,7 @@ namespace pb_ds
template<typename Key, template<typename Key,
size_t Init_Size = 8, size_t Init_Size = 8,
typename Hash_Fn = typename pb_ds::detail::default_hash_fn<Key>::type, typename Hash_Fn = typename pb_ds::detail::default_hash_fn<Key>::type,
typename Eq_Fn = std::equal_to<Key>, typename Eq_Fn = std::equal_to<Key>,
typename Less_Fn = std::less<Key>, typename Less_Fn = std::less<Key>,
typename Allocator = std::allocator<char> typename Allocator = std::allocator<char>
......
...@@ -48,30 +48,22 @@ ...@@ -48,30 +48,22 @@
#define PB_DS_NATIVE_MAP_HPP #define PB_DS_NATIVE_MAP_HPP
#include <map> #include <map>
#include <string>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <native_type/assoc/native_tree_tag.hpp> #include <native_type/assoc/native_tree_tag.hpp>
#include <io/xml.hpp> #include <io/xml.hpp>
#include <string>
namespace pb_ds namespace pb_ds
{ {
namespace test namespace test
{ {
#define PB_DS_BASE_C_DEC \
#define PB_DS_BASE_C_DEC \ std::map<Key, Data, Cmp_Fn, \
std::map< \ typename Allocator::template rebind<std::pair<const Key, Data > >::other >
Key, \
Data, \
Cmp_Fn, \
typename Allocator::template rebind< \
std::pair< \
const Key, \
Data > >::other >
template<typename Key, typename Data, class Cmp_Fn = std::less<Key>, template<typename Key, typename Data, class Cmp_Fn = std::less<Key>,
class Allocator = class Allocator = std::allocator<char> >
std::allocator<char> >
class native_map : public PB_DS_BASE_C_DEC class native_map : public PB_DS_BASE_C_DEC
{ {
private: private:
...@@ -80,7 +72,6 @@ namespace pb_ds ...@@ -80,7 +72,6 @@ namespace pb_ds
public: public:
typedef native_tree_tag container_category; typedef native_tree_tag container_category;
public:
native_map() : base_type() native_map() : base_type()
{ } { }
...@@ -90,15 +81,11 @@ namespace pb_ds ...@@ -90,15 +81,11 @@ namespace pb_ds
static std::string static std::string
name() name()
{ { return std::string("n_map"); }
return ("n_map");
}
static std::string static std::string
desc() desc()
{ { return make_xml_tag("type", "value", "std_map"); }
return (make_xml_tag( "type", "value", "std_map"));
}
}; };
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
......
...@@ -48,38 +48,20 @@ ...@@ -48,38 +48,20 @@
#define PB_DS_NATIVE_MULTIMAP_HPP #define PB_DS_NATIVE_MULTIMAP_HPP
#include <map> #include <map>
#include <native_type/assoc/native_tree_tag.hpp>
#include <string> #include <string>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <native_type/assoc/native_tree_tag.hpp>
namespace pb_ds namespace pb_ds
{ {
namespace test namespace test
{ {
#define PB_DS_BASE_C_DEC \
#define PB_DS_CLASS_T_DEC \ std::multimap<Key, Data, Less_Fn, \
template<typename Key, typename Data, class Less_Fn, class Allocator> typename Allocator::template rebind<std::pair<const Key, Data> >::other>
#define PB_DS_CLASS_C_DEC \
native_multimap< \
Key, \
Data, \
Less_Fn, \
Allocator>
#define PB_DS_BASE_C_DEC \
std::multimap< \
Key, \
Data, \
Less_Fn, \
typename Allocator::template rebind< \
std::pair< \
const Key, \
Data> >::other >
template<typename Key, typename Data, class Less_Fn = std::less<Key>, template<typename Key, typename Data, class Less_Fn = std::less<Key>,
class Allocator = class Allocator = std::allocator<char> >
std::allocator<char> >
class native_multimap : public PB_DS_BASE_C_DEC class native_multimap : public PB_DS_BASE_C_DEC
{ {
private: private:
...@@ -92,55 +74,41 @@ namespace pb_ds ...@@ -92,55 +74,41 @@ namespace pb_ds
typedef typedef
typename Allocator::template rebind< typename Allocator::template rebind<
std::pair< std::pair<Key, Data> >::other::const_reference
Key,
Data> >::other::const_reference
const_reference; const_reference;
typedef typename base_type::iterator iterator; typedef typename base_type::iterator iterator;
typedef typename base_type::const_iterator const_iterator; typedef typename base_type::const_iterator const_iterator;
public: native_multimap() { }
native_multimap();
template<typename It>
native_multimap(It f, It l) : base_type(f, l)
{ }
inline void inline void
insert(const_reference r_val) insert(const_reference r_val)
{ {
typedef typedef std::pair<iterator, iterator> eq_range_t;
std::pair<
typename base_type::iterator,
typename base_type::iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::iterator it = f.first; iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
return; return;
++it; ++it;
} }
base_type::insert(r_val); base_type::insert(r_val);
} }
inline iterator inline iterator
find(const_reference r_val) find(const_reference r_val)
{ {
typedef typedef std::pair<iterator, iterator> eq_range_t;
std::pair<
typename base_type::iterator,
typename base_type::iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::iterator it = f.first; iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
...@@ -154,55 +122,28 @@ namespace pb_ds ...@@ -154,55 +122,28 @@ namespace pb_ds
inline const_iterator inline const_iterator
find(const_reference r_val) const find(const_reference r_val) const
{ {
typedef typedef std::pair<const_iterator, const_iterator> eq_range_t;
std::pair<
typename base_type::const_iterator,
typename base_type::const_iterator>
eq_range_t;
eq_range_t f = base_type::equal_range(r_val.first); eq_range_t f = base_type::equal_range(r_val.first);
typename base_type::const_iterator it = f.first; const_iterator it = f.first;
while (it != f.second) while (it != f.second)
{ {
if (it->second == r_val.second) if (it->second == r_val.second)
return it; return it;
++it; ++it;
} }
return base_type::end(); return base_type::end();
} }
template<typename It>
native_multimap(It f, It l);
static std::string static std::string
name() name()
{ { return std::string("n_mmap"); }
return ("n_mmap");
}
static std::string static std::string
desc() desc()
{ { return make_xml_tag("type", "value", "std_multimap"); }
return (make_xml_tag("type", "value", "std_multimap"));
}
}; };
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
native_multimap()
{ }
PB_DS_CLASS_T_DEC
template<typename It>
PB_DS_CLASS_C_DEC::
native_multimap(It f, It l) : base_type(f, l)
{ }
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
} // namespace test } // namespace test
......
...@@ -47,38 +47,30 @@ ...@@ -47,38 +47,30 @@
#ifndef PB_DS_NATIVE_SET_HPP #ifndef PB_DS_NATIVE_SET_HPP
#define PB_DS_NATIVE_SET_HPP #define PB_DS_NATIVE_SET_HPP
#include <string>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>
#include <native_type/assoc/native_tree_tag.hpp> #include <native_type/assoc/native_tree_tag.hpp>
#include <io/xml.hpp> #include <io/xml.hpp>
#include <string>
namespace pb_ds namespace pb_ds
{ {
namespace test namespace test
{ {
#define PB_DS_BASE_C_DEC \
#define PB_DS_BASE_C_DEC \ std::set<Key, Cmp_Fn, typename Allocator::template rebind<Key>::other>
std::set< \
Key, \
Cmp_Fn, \
typename Allocator::template rebind< \
Key>::other>
template<typename Key, class Cmp_Fn = std::less<Key>, template<typename Key, class Cmp_Fn = std::less<Key>,
class Allocator = class Allocator = std::allocator<char> >
std::allocator<char> >
class native_set : public PB_DS_BASE_C_DEC class native_set : public PB_DS_BASE_C_DEC
{ {
private: private:
typedef PB_DS_BASE_C_DEC base_type; typedef PB_DS_BASE_C_DEC base_type;
public: public:
typedef native_tree_tag container_category; typedef native_tree_tag container_category;
typedef typename base_type::const_iterator const_iterator;
typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
public:
native_set() : base_type() native_set() : base_type()
{ } { }
...@@ -91,21 +83,15 @@ namespace pb_ds ...@@ -91,21 +83,15 @@ namespace pb_ds
static std::string static std::string
name() name()
{ { return std::string("n_set"); }
return ("n_set");
}
static std::string static std::string
desc() desc()
{ { return make_xml_tag("type", "value", "std_set"); }
return (make_xml_tag( "type", "value", "std_set"));
}
}; };
#undef PB_DS_BASE_C_DEC #undef PB_DS_BASE_C_DEC
} // namespace test } // namespace test
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_NATIVE_SET_HPP #endif // #ifndef PB_DS_NATIVE_SET_HPP
...@@ -49,15 +49,11 @@ ...@@ -49,15 +49,11 @@
namespace pb_ds namespace pb_ds
{ {
namespace test namespace test
{ {
struct native_tree_tag struct native_tree_tag
{ }; { };
} // namespace test } // namespace test
} // namespace pb_ds } // namespace pb_ds
#endif // #ifndef PB_DS_NATIVE_TREE_DS_TAG_HPP #endif // #ifndef PB_DS_NATIVE_TREE_DS_TAG_HPP
...@@ -74,7 +74,7 @@ namespace pb_ds ...@@ -74,7 +74,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
erase_test(const erase_test& ); erase_test(const erase_test& );
...@@ -100,7 +100,7 @@ namespace pb_ds ...@@ -100,7 +100,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -75,18 +75,18 @@ namespace pb_ds ...@@ -75,18 +75,18 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
multimap_insert_test(const multimap_insert_test& ); multimap_insert_test(const multimap_insert_test& );
template<typename Cntnr> template<typename Cntnr>
size_t size_t
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::true_type); insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::true_type);
template<typename Cntnr> template<typename Cntnr>
size_t size_t
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::false_type); insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::false_type);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -109,7 +109,7 @@ namespace pb_ds ...@@ -109,7 +109,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -123,7 +123,7 @@ namespace pb_ds ...@@ -123,7 +123,7 @@ namespace pb_ds
It ins_it_e = m_ins_b; It ins_it_e = m_ins_b;
std::advance(ins_it_e, ins_size); std::advance(ins_it_e, ins_size);
const size_t delta_mem = insert(pb_ds::detail::type_to_type<Cntnr>(), const size_t delta_mem = insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>(),
ins_it_b, ins_it_b,
ins_it_e, ins_it_e,
pb_ds::detail::integral_constant<int,Native>()); pb_ds::detail::integral_constant<int,Native>());
...@@ -136,7 +136,7 @@ namespace pb_ds ...@@ -136,7 +136,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
size_t size_t
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::true_type) insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::true_type)
{ {
mem_track_allocator<char> alloc; mem_track_allocator<char> alloc;
...@@ -158,7 +158,7 @@ namespace pb_ds ...@@ -158,7 +158,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
size_t size_t
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::false_type) insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e, pb_ds::detail::false_type)
{ {
mem_track_allocator<char> alloc; mem_track_allocator<char> alloc;
......
...@@ -129,8 +129,8 @@ namespace pb_ds ...@@ -129,8 +129,8 @@ namespace pb_ds
public: public:
typedef typedef
typename pb_ds::detail::typelist_flatten< typename __gnu_cxx::typelist::flatten<
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
Sec_Tl, Sec_Tl,
hash_mmap_transform>::type>::type hash_mmap_transform>::type>::type
type; type;
...@@ -159,8 +159,8 @@ namespace pb_ds ...@@ -159,8 +159,8 @@ namespace pb_ds
public: public:
typedef typedef
typename pb_ds::detail::typelist_flatten< typename __gnu_cxx::typelist::flatten<
typename pb_ds::detail::typelist_transform< typename __gnu_cxx::typelist::transform<
Sec_Tl, Sec_Tl,
tree_mmap_transform>::type>::type tree_mmap_transform>::type>::type
type; type;
...@@ -242,11 +242,11 @@ namespace pb_ds ...@@ -242,11 +242,11 @@ namespace pb_ds
public: public:
typedef typedef
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
hl_mmap_tl_t, hl_mmap_tl_t,
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
hh_mmap_tl_t, hh_mmap_tl_t,
typename pb_ds::detail::typelist_append< typename __gnu_cxx::typelist::append<
th_mmap_tl_t, th_mmap_tl_t,
tl_mmap_tl_t>::type>::type>::type tl_mmap_tl_t>::type>::type>::type
type; type;
......
...@@ -73,8 +73,8 @@ namespace pb_ds ...@@ -73,8 +73,8 @@ namespace pb_ds
}; };
typedef typedef
pb_ds::detail::typelist_flatten< __gnu_cxx::typelist::flatten<
pb_ds::detail::typelist_transform< __gnu_cxx::typelist::transform<
hash_set_tl_t, hash_set_tl_t,
hash_mmap_transform>::type>::type hash_mmap_transform>::type>::type
hash_mmap_tl_t; hash_mmap_tl_t;
...@@ -97,8 +97,8 @@ namespace pb_ds ...@@ -97,8 +97,8 @@ namespace pb_ds
}; };
typedef typedef
pb_ds::detail::typelist_flatten< __gnu_cxx::typelist::flatten<
pb_ds::detail::typelist_transform< __gnu_cxx::typelist::transform<
tree_set_tl_t, tree_set_tl_t,
tree_mmap_transform>::type>::type tree_mmap_transform>::type>::type
tree_mmap_tl_t; tree_mmap_tl_t;
......
...@@ -140,7 +140,7 @@ namespace pb_ds ...@@ -140,7 +140,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
find_test(const find_test& ); find_test(const find_test& );
...@@ -176,7 +176,7 @@ namespace pb_ds ...@@ -176,7 +176,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -104,14 +104,14 @@ namespace pb_ds ...@@ -104,14 +104,14 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
insert_test(const insert_test& ); insert_test(const insert_test& );
template<typename Cntnr> template<typename Cntnr>
void void
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e); insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -134,7 +134,7 @@ namespace pb_ds ...@@ -134,7 +134,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -162,7 +162,7 @@ namespace pb_ds ...@@ -162,7 +162,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
insert(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e) insert(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e)
{ {
Cntnr cntnr; Cntnr cntnr;
......
...@@ -155,18 +155,18 @@ namespace pb_ds ...@@ -155,18 +155,18 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
multimap_find_test(const multimap_find_test& ); multimap_find_test(const multimap_find_test& );
template<typename Cntnr> template<typename Cntnr>
Cntnr Cntnr
init(It ins_b, It ins_e, pb_ds::detail::type_to_type<Cntnr>, pb_ds::detail::true_type); init(It ins_b, It ins_e, __gnu_cxx::typelist::detail::type_to_type<Cntnr>, pb_ds::detail::true_type);
template<typename Cntnr> template<typename Cntnr>
Cntnr Cntnr
init(It ins_b, It ins_e, pb_ds::detail::type_to_type<Cntnr>, pb_ds::detail::false_type); init(It ins_b, It ins_e, __gnu_cxx::typelist::detail::type_to_type<Cntnr>, pb_ds::detail::false_type);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -189,7 +189,7 @@ namespace pb_ds ...@@ -189,7 +189,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -205,7 +205,7 @@ namespace pb_ds ...@@ -205,7 +205,7 @@ namespace pb_ds
Cntnr c = init(ins_it_b, Cntnr c = init(ins_it_b,
ins_it_e, ins_it_e,
pb_ds::detail::type_to_type<Cntnr>(), __gnu_cxx::typelist::detail::type_to_type<Cntnr>(),
pb_ds::detail::integral_constant<int,Native>()); pb_ds::detail::integral_constant<int,Native>());
pb_ds::test::detail::multimap_find_functor<It, Cntnr, Native> pb_ds::test::detail::multimap_find_functor<It, Cntnr, Native>
...@@ -222,7 +222,7 @@ namespace pb_ds ...@@ -222,7 +222,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
Cntnr Cntnr
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
init(It ins_b, It ins_e, pb_ds::detail::type_to_type<Cntnr>, pb_ds::detail::true_type) init(It ins_b, It ins_e, __gnu_cxx::typelist::detail::type_to_type<Cntnr>, pb_ds::detail::true_type)
{ {
return Cntnr(ins_b, ins_e); return Cntnr(ins_b, ins_e);
} }
...@@ -231,7 +231,7 @@ namespace pb_ds ...@@ -231,7 +231,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
Cntnr Cntnr
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
init(It ins_b, It ins_e, pb_ds::detail::type_to_type<Cntnr>, pb_ds::detail::false_type) init(It ins_b, It ins_e, __gnu_cxx::typelist::detail::type_to_type<Cntnr>, pb_ds::detail::false_type)
{ {
Cntnr ret; Cntnr ret;
......
...@@ -132,7 +132,7 @@ namespace pb_ds ...@@ -132,7 +132,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
multimap_insert_test(const multimap_insert_test& ); multimap_insert_test(const multimap_insert_test& );
...@@ -158,7 +158,7 @@ namespace pb_ds ...@@ -158,7 +158,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -106,7 +106,7 @@ namespace pb_ds ...@@ -106,7 +106,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
subscript_find_test(const subscript_find_test& ); subscript_find_test(const subscript_find_test& );
...@@ -142,7 +142,7 @@ namespace pb_ds ...@@ -142,7 +142,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -104,7 +104,7 @@ namespace pb_ds ...@@ -104,7 +104,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
subscript_insert_test(const subscript_insert_test& ); subscript_insert_test(const subscript_insert_test& );
...@@ -140,7 +140,7 @@ namespace pb_ds ...@@ -140,7 +140,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -157,7 +157,7 @@ namespace pb_ds ...@@ -157,7 +157,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
tree_order_statistics_test(const tree_order_statistics_test& ); tree_order_statistics_test(const tree_order_statistics_test& );
...@@ -188,7 +188,7 @@ namespace pb_ds ...@@ -188,7 +188,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -134,7 +134,7 @@ namespace pb_ds ...@@ -134,7 +134,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
tree_split_join_test(const tree_split_join_test& ); tree_split_join_test(const tree_split_join_test& );
...@@ -157,7 +157,7 @@ namespace pb_ds ...@@ -157,7 +157,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -74,7 +74,7 @@ namespace pb_ds ...@@ -74,7 +74,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
pop_test(const pop_test& ); pop_test(const pop_test& );
...@@ -100,7 +100,7 @@ namespace pb_ds ...@@ -100,7 +100,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
......
...@@ -128,7 +128,7 @@ namespace pb_ds ...@@ -128,7 +128,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
using pb_ds::test::detail::double_push_functor; using pb_ds::test::detail::double_push_functor;
using pb_ds::test::detail::double_push_join_functor; using pb_ds::test::detail::double_push_join_functor;
...@@ -159,7 +159,7 @@ namespace pb_ds ...@@ -159,7 +159,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
join(pb_ds::detail::type_to_type<Cntnr>, It b, It e) join(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It b, It e)
{ {
Cntnr cntnr; Cntnr cntnr;
typedef typename Cntnr::const_reference const_reference; typedef typename Cntnr::const_reference const_reference;
......
...@@ -283,14 +283,14 @@ namespace pb_ds ...@@ -283,14 +283,14 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
modify_test(const modify_test& ); modify_test(const modify_test& );
template<typename Cntnr> template<typename Cntnr>
void void
modify(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e); modify(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -316,7 +316,7 @@ namespace pb_ds ...@@ -316,7 +316,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -367,7 +367,7 @@ namespace pb_ds ...@@ -367,7 +367,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
modify(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e) modify(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e)
{ {
Cntnr cntnr; Cntnr cntnr;
......
...@@ -107,14 +107,14 @@ namespace pb_ds ...@@ -107,14 +107,14 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
push_pop_test(const push_pop_test& ); push_pop_test(const push_pop_test& );
template<typename Cntnr> template<typename Cntnr>
void void
push(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e); push(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -137,7 +137,7 @@ namespace pb_ds ...@@ -137,7 +137,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -165,7 +165,7 @@ namespace pb_ds ...@@ -165,7 +165,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
push(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e) push(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e)
{ {
Cntnr cntnr; Cntnr cntnr;
......
...@@ -104,14 +104,14 @@ namespace pb_ds ...@@ -104,14 +104,14 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>); operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>);
private: private:
push_test(const push_test& ); push_test(const push_test& );
template<typename Cntnr> template<typename Cntnr>
void void
push(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e); push(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e);
private: private:
const It m_ins_b; const It m_ins_b;
...@@ -134,7 +134,7 @@ namespace pb_ds ...@@ -134,7 +134,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
xml_result_set_performance_formatter res_set_fmt( xml_result_set_performance_formatter res_set_fmt(
string_form<Cntnr>::name(), string_form<Cntnr>::name(),
...@@ -162,7 +162,7 @@ namespace pb_ds ...@@ -162,7 +162,7 @@ namespace pb_ds
template<typename Cntnr> template<typename Cntnr>
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
push(pb_ds::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e) push(__gnu_cxx::typelist::detail::type_to_type<Cntnr>, It ins_it_b, It ins_it_e)
{ {
Cntnr cntnr; Cntnr cntnr;
......
...@@ -82,7 +82,7 @@ namespace test ...@@ -82,7 +82,7 @@ namespace test
typedef typename tree_common_types<basic_type, Data_Type, std::less<basic_type>, pb_ds::tree_order_statistics_node_update, alloc_type>::regression_tl order_statistics_tl_t; typedef typename tree_common_types<basic_type, Data_Type, std::less<basic_type>, pb_ds::tree_order_statistics_node_update, alloc_type>::regression_tl order_statistics_tl_t;
public: public:
typedef typename pb_ds::detail::typelist_append<no_order_statistics_tl_t, order_statistics_tl_t>::type tl_t; typedef typename __gnu_cxx::typelist::append<no_order_statistics_tl_t, order_statistics_tl_t>::type tl_t;
typedef no_order_statistics_tl_t min_tl_t; typedef no_order_statistics_tl_t min_tl_t;
}; };
...@@ -98,7 +98,7 @@ namespace test ...@@ -98,7 +98,7 @@ namespace test
typedef typename trie_common_types<basic_type, Data_Type, e_access_traits_t, pb_ds::pat_trie_tag, pb_ds::trie_prefix_search_node_update, alloc_type>::regression_tl prefix_search_tl_t; typedef typename trie_common_types<basic_type, Data_Type, e_access_traits_t, pb_ds::pat_trie_tag, pb_ds::trie_prefix_search_node_update, alloc_type>::regression_tl prefix_search_tl_t;
public: public:
typedef typename pb_ds::detail::typelist_append<no_updates_tl_t, typename pb_ds::detail::typelist_append<prefix_search_tl_t, order_statistics_tl_t>::type>::type tl_t; typedef typename __gnu_cxx::typelist::append<no_updates_tl_t, typename __gnu_cxx::typelist::append<prefix_search_tl_t, order_statistics_tl_t>::type>::type tl_t;
typedef no_updates_tl_t min_tl_t; typedef no_updates_tl_t min_tl_t;
}; };
......
...@@ -76,7 +76,7 @@ namespace detail ...@@ -76,7 +76,7 @@ namespace detail
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
unsigned long ul = static_cast<unsigned long>(m_sd); unsigned long ul = static_cast<unsigned long>(m_sd);
container_rand_regression_test<Cntnr> t(ul, m_n, m_n, m_tp, m_ip, container_rand_regression_test<Cntnr> t(ul, m_n, m_n, m_tp, m_ip,
...@@ -143,7 +143,7 @@ namespace detail ...@@ -143,7 +143,7 @@ namespace detail
try try
{ {
detail::rand_reg_test tst(sd, n, m, tp, ip, ep, cp, mp, disp); detail::rand_reg_test tst(sd, n, m, tp, ip, ep, cp, mp, disp);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
catch(...) catch(...)
{ {
......
...@@ -76,7 +76,7 @@ namespace detail ...@@ -76,7 +76,7 @@ namespace detail
template<typename Cntnr> template<typename Cntnr>
void void
operator()(pb_ds::detail::type_to_type<Cntnr>) operator()(__gnu_cxx::typelist::detail::type_to_type<Cntnr>)
{ {
unsigned long ul = static_cast<unsigned long>(m_sd); unsigned long ul = static_cast<unsigned long>(m_sd);
container_rand_regression_test<Cntnr> t(ul, m_n, m_n, m_tp, m_ip, m_dp, container_rand_regression_test<Cntnr> t(ul, m_n, m_n, m_tp, m_ip, m_dp,
...@@ -145,7 +145,7 @@ namespace detail ...@@ -145,7 +145,7 @@ namespace detail
try try
{ {
detail::rand_reg_test tst(sd, n, m, tp, ip, dp, ep, cp, mp, disp); detail::rand_reg_test tst(sd, n, m, tp, ip, dp, ep, cp, mp, disp);
pb_ds::detail::typelist_apply(tst, tl); __gnu_cxx::typelist::apply(tst, tl);
} }
catch(...) catch(...)
{ {
......
...@@ -93,7 +93,7 @@ namespace pb_ds ...@@ -93,7 +93,7 @@ namespace pb_ds
generate_value(Gen& r_gen, size_t max) generate_value(Gen& r_gen, size_t max)
{ {
return (generate_value(r_gen, max, return (generate_value(r_gen, max,
pb_ds::detail::type_to_type<value_type>())); __gnu_cxx::typelist::detail::type_to_type<value_type>()));
} }
static const_key_reference static const_key_reference
...@@ -118,21 +118,21 @@ namespace pb_ds ...@@ -118,21 +118,21 @@ namespace pb_ds
private: private:
template<typename Gen> template<typename Gen>
static value_type static value_type
generate_value(Gen& r_gen, size_t max, pb_ds::detail::type_to_type<pb_ds::null_mapped_type>) generate_value(Gen& r_gen, size_t max, __gnu_cxx::typelist::detail::type_to_type<pb_ds::null_mapped_type>)
{ {
return (basic_type(r_gen, max)); return (basic_type(r_gen, max));
} }
template<typename Gen> template<typename Gen>
static value_type static value_type
generate_value(Gen& r_gen, size_t max, pb_ds::detail::type_to_type<basic_type>) generate_value(Gen& r_gen, size_t max, __gnu_cxx::typelist::detail::type_to_type<basic_type>)
{ {
return (basic_type(r_gen, max)); return (basic_type(r_gen, max));
} }
template<typename Gen> template<typename Gen>
static value_type static value_type
generate_value(Gen& r_gen, size_t max, pb_ds::detail::type_to_type<std::pair<const basic_type, basic_type> >) generate_value(Gen& r_gen, size_t max, __gnu_cxx::typelist::detail::type_to_type<std::pair<const basic_type, basic_type> >)
{ {
return (std::make_pair(basic_type(r_gen, max), basic_type(r_gen, max))); return (std::make_pair(basic_type(r_gen, max), basic_type(r_gen, max)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment