41#ifndef PB_DS_ASSOC_CNTNR_HPP
42#define PB_DS_ASSOC_CNTNR_HPP
64#define PB_DS_HASH_BASE \
65 detail::container_base_dispatch<Key, Mapped, _Alloc, Tag, \
66 typename __gnu_cxx::typelist::append< \
67 typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, \
68 detail::integral_constant<int, Store_Hash> >::type, Policy_Tl>::type>::type
95 template<
typename Key,
99 typename Resize_Policy,
104 class basic_hash_table :
public PB_DS_HASH_BASE
107 typedef typename PB_DS_HASH_BASE base_type;
111 ~basic_hash_table() { }
114 basic_hash_table() { }
116 basic_hash_table(
const basic_hash_table& other)
117 : base_type((
const base_type&)other) { }
119 template<
typename T0>
120 basic_hash_table(T0 t0) : base_type(t0) { }
122 template<
typename T0,
typename T1>
123 basic_hash_table(T0 t0, T1 t1) : base_type(t0, t1) { }
125 template<
typename T0,
typename T1,
typename T2>
126 basic_hash_table(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2) { }
128 template<
typename T0,
typename T1,
typename T2,
typename T3>
129 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3)
130 : base_type(t0, t1, t2, t3) { }
132 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
133 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
134 : base_type(t0, t1, t2, t3, t4) { }
136 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
138 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
139 : base_type(t0, t1, t2, t3, t4, t5) { }
141 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
142 typename T5,
typename T6>
143 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
144 : base_type(t0, t1, t2, t3, t4, t5, t6) { }
146 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
147 typename T5,
typename T6,
typename T7>
148 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
149 : base_type(t0, t1, t2, t3, t4, t5, t6, t7) { }
151 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
152 typename T5,
typename T6,
typename T7,
typename T8>
153 basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6,
155 : base_type(t0, t1, t2, t3, t4, t5, t6, t7, t8)
160 operator=(
const base_type&);
163#undef PB_DS_HASH_BASE
166#define PB_DS_CC_HASH_BASE \
167 basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
169 typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, _Alloc>
196 template<
typename Key,
202 bool Store_Hash = detail::default_store_hash,
207 typedef PB_DS_CC_HASH_BASE base_type;
211 typedef Hash_Fn hash_fn;
213 typedef Resize_Policy resize_policy;
214 typedef Comb_Hash_Fn comb_hash_fn;
229 : base_type(h, e) { }
237 : base_type(h, e, ch) { }
246 const resize_policy& rp)
247 : base_type(h, e, ch, rp) { }
252 template<
typename It>
254 { base_type::copy_from_range(first, last); }
259 template<
typename It>
262 { this->copy_from_range(first, last); }
270 template<
typename It>
273 { this->copy_from_range(first, last); }
282 template<
typename It>
284 const comb_hash_fn& ch)
285 : base_type(h, e, ch)
286 { this->copy_from_range(first, last); }
296 template<
typename It>
298 const comb_hash_fn& ch,
const resize_policy& rp)
299 : base_type(h, e, ch, rp)
300 { this->copy_from_range(first, last); }
303 : base_type((const base_type&)other)
322 { base_type::swap(other); }
325#undef PB_DS_CC_HASH_BASE
328#define PB_DS_GP_HASH_BASE \
329 basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
331 typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, _Alloc>
359 template<
typename Key,
366 bool Store_Hash = detail::default_store_hash,
367 typename _Alloc = std::allocator<char> >
371 typedef PB_DS_GP_HASH_BASE base_type;
375 typedef Hash_Fn hash_fn;
377 typedef Comb_Probe_Fn comb_probe_fn;
378 typedef Probe_Fn probe_fn;
379 typedef Resize_Policy resize_policy;
394 : base_type(h, e) { }
402 : base_type(h, e, cp) { }
412 : base_type(h, e, cp, p) { }
423 const probe_fn& p,
const resize_policy& rp)
424 : base_type(h, e, cp, p, rp) { }
429 template<
typename It>
431 { base_type::copy_from_range(first, last); }
437 template<
typename It>
440 { base_type::copy_from_range(first, last); }
448 template<
typename It>
451 { base_type::copy_from_range(first, last); }
460 template<
typename It>
462 const comb_probe_fn& cp)
463 : base_type(h, e, cp)
464 { base_type::copy_from_range(first, last); }
474 template<
typename It>
476 const comb_probe_fn& cp,
const probe_fn& p)
477 : base_type(h, e, cp, p)
478 { base_type::copy_from_range(first, last); }
490 template<
typename It>
492 const comb_probe_fn& cp,
const probe_fn& p,
493 const resize_policy& rp)
494 : base_type(h, e, cp, p, rp)
495 { base_type::copy_from_range(first, last); }
498 : base_type((const base_type&)other)
517 { base_type::swap(other); }
520#undef PB_DS_GP_HASH_BASE
528#define PB_DS_BRANCH_BASE \
529 detail::container_base_dispatch<Key, Mapped, _Alloc, Tag, Policy_Tl>::type
553 template<
typename Key,
typename Mapped,
typename Tag,
554 typename Node_Update,
typename Policy_Tl,
typename _Alloc>
555 class basic_branch :
public PB_DS_BRANCH_BASE
558 typedef typename PB_DS_BRANCH_BASE base_type;
561 typedef Node_Update node_update;
569 basic_branch(
const basic_branch& other)
570 : base_type((
const base_type&)other) { }
572 template<
typename T0>
573 basic_branch(T0 t0) : base_type(t0) { }
575 template<
typename T0,
typename T1>
576 basic_branch(T0 t0, T1 t1) : base_type(t0, t1) { }
578 template<
typename T0,
typename T1,
typename T2>
579 basic_branch(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2) { }
581 template<
typename T0,
typename T1,
typename T2,
typename T3>
582 basic_branch(T0 t0, T1 t1, T2 t2, T3 t3)
583 : base_type(t0, t1, t2, t3) { }
585 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
586 basic_branch(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
587 : base_type(t0, t1, t2, t3, t4) { }
589 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
591 basic_branch(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
592 : base_type(t0, t1, t2, t3, t4, t5) { }
594 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
595 typename T5,
typename T6>
596 basic_branch(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
597 : base_type(t0, t1, t2, t3, t4, t5, t6) { }
599#undef PB_DS_BRANCH_BASE
602#define PB_DS_TREE_NODE_AND_IT_TRAITS \
603 detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag,_Alloc>
605#define PB_DS_TREE_BASE \
606 basic_branch<Key,Mapped, Tag, \
607 typename PB_DS_TREE_NODE_AND_IT_TRAITS::node_update, \
608 typename __gnu_cxx::typelist::create2<Cmp_Fn, \
609 PB_DS_TREE_NODE_AND_IT_TRAITS>::type, _Alloc>
629 template<
typename Key,
typename Mapped,
typename Cmp_Fn = std::less<Key>,
630 typename Tag = rb_tree_tag,
631 template<
typename Node_CItr,
typename Node_Itr,
632 typename Cmp_Fn_,
typename _Alloc_>
635 class tree :
public PB_DS_TREE_BASE
638 typedef PB_DS_TREE_BASE base_type;
654 template<
typename It>
656 { base_type::copy_from_range(first, last); }
662 template<
typename It>
665 { base_type::copy_from_range(first, last); }
668 : base_type((const base_type&)other) { }
674 operator=(
const tree& other)
686 { base_type::swap(other); }
689#undef PB_DS_TREE_BASE
690#undef PB_DS_TREE_NODE_AND_IT_TRAITS
693#define PB_DS_TRIE_NODE_AND_IT_TRAITS \
694 detail::trie_traits<Key,Mapped,_ATraits,Node_Update,Tag,_Alloc>
696#define PB_DS_TRIE_BASE \
697 basic_branch<Key,Mapped,Tag, \
698 typename PB_DS_TRIE_NODE_AND_IT_TRAITS::node_update, \
699 typename __gnu_cxx::typelist::create2<_ATraits, \
700 PB_DS_TRIE_NODE_AND_IT_TRAITS >::type, _Alloc>
720 template<
typename Key,
722 typename _ATraits = \
725 template<
typename Node_CItr,
730 typename _Alloc = std::allocator<char> >
731 class trie :
public PB_DS_TRIE_BASE
734 typedef PB_DS_TRIE_BASE base_type;
750 template<
typename It>
752 { base_type::copy_from_range(first, last); }
757 template<
typename It>
760 { base_type::copy_from_range(first, last); }
763 : base_type((const base_type&)other) { }
769 operator=(
const trie& other)
781 { base_type::swap(other); }
784#undef PB_DS_TRIE_BASE
785#undef PB_DS_TRIE_NODE_AND_IT_TRAITS
793#define PB_DS_LU_BASE \
794 detail::container_base_dispatch<Key, Mapped, _Alloc, list_update_tag, \
795 typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type>::type
810 template<
typename Key,
814 class _Alloc = std::allocator<char> >
815 class list_update :
public PB_DS_LU_BASE
818 typedef typename PB_DS_LU_BASE base_type;
823 typedef Update_Policy update_policy;
830 template<
typename It>
832 { base_type::copy_from_range(first, last); }
835 : base_type((const base_type&)other) { }
841 operator=(
const list_update& other)
845 list_update tmp(other);
852 swap(list_update& other)
853 { base_type::swap(other); }
GNU extensions for policy-based data structures for public use.
The standard allocator, as per C++03 [20.4.1].
cc_hash_table(It first, It last, const hash_fn &h, const eq_fn &e, const comb_hash_fn &ch)
Constructor taking __iterators to a range of value_types and some policy objects The value_types betw...
cc_hash_table(const hash_fn &h, const eq_fn &e)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
cc_hash_table(const hash_fn &h, const eq_fn &e, const comb_hash_fn &ch)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
cc_hash_table(It first, It last, const hash_fn &h, const eq_fn &e, const comb_hash_fn &ch, const resize_policy &rp)
Constructor taking __iterators to a range of value_types and some policy objects The value_types betw...
cc_hash_table(It first, It last, const hash_fn &h)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
cc_hash_table()
Default constructor.
cc_hash_table(It first, It last)
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_i...
cc_hash_table(It first, It last, const hash_fn &h, const eq_fn &e)
Constructor taking __iterators to a range of value_types and some policy objects The value_types betw...
cc_hash_table(const hash_fn &h)
Constructor taking some policy objects. r_hash_fn will be copied by the Hash_Fn object of the contain...
cc_hash_table(const hash_fn &h, const eq_fn &e, const comb_hash_fn &ch, const resize_policy &rp)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
gp_hash_table(const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp, const probe_fn &p)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
gp_hash_table(It first, It last, const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp, const probe_fn &p, const resize_policy &rp)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
gp_hash_table()
Default constructor.
gp_hash_table(It first, It last, const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp, const probe_fn &p)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
gp_hash_table(It first, It last, const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
gp_hash_table(It first, It last)
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_i...
gp_hash_table(const hash_fn &h, const eq_fn &e)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
gp_hash_table(const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp, const probe_fn &p, const resize_policy &rp)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
gp_hash_table(It first, It last, const hash_fn &h)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
gp_hash_table(const hash_fn &h)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
gp_hash_table(It first, It last, const hash_fn &h, const eq_fn &e)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
gp_hash_table(const hash_fn &h, const eq_fn &e, const comb_probe_fn &cp)
Constructor taking some policy objects. r_hash_fn will be copied by the hash_fn object of the contain...
tree(const cmp_fn &c)
Constructor taking some policy objects. r_cmp_fn will be copied by the Cmp_Fn object of the container...
tree(It first, It last, const cmp_fn &c)
Constructor taking __iterators to a range of value_types and some policy objects The value_types betw...
tree(It first, It last)
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_i...
Cmp_Fn cmp_fn
Comparison functor type.
trie(It first, It last)
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_i...
trie(It first, It last, const access_traits &t)
Constructor taking __iterators to a range of value_types and some policy objects. The value_types bet...
trie(const access_traits &t)
Constructor taking some policy objects. r_access_traits will be copied by the _ATraits object of the ...
_ATraits access_traits
Element access traits type.
list_update(It first, It last)
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_i...
A null node updator, indicating that no node updates are required.
std::tr1::hash< Key > type
Dispatched type.
std::equal_to< Key > type
Dispatched type.
direct_mask_range_hashing type
Dispatched type.
hash_standard_resize_policy< size_policy_type, trigger, false, size_type > type
Dispatched type.
lu_move_to_front_policy type
Dispatched type.
cond_type::__type type
Dispatched type.
Primary template, default_trie_access_traits.