1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
4 <title>Examples
</title>
5 <meta name=
"GENERATOR" content=
"Microsoft Visual Studio .NET 7.1">
6 <meta name=
"vs_targetSchema" content=
"http://schemas.microsoft.com/intellisense/ie5">
8 <body bgcolor =
"white">
12 <li><a href =
"#basic_usage">Basic use
</a></li>
13 <li><a href =
"#generics">Generics
</a></li>
14 <li><a href =
"#hash_based">Hash-Based Containers
</a></li>
15 <li><a href =
"#tree_based">Tree-Based Containers
</a></li>
18 <h2><a name =
"basic_usage">Basic Use
</a></h2>
21 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/basic_map.cc"><tt>basic_map.cc
</tt></a>- Basic use of
"maps
".
</li>
22 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/basic_set.cc"><tt>basic_set.cc
</tt></a>- Basic use of
"sets
".
24 <a href =
"ms_gen.html#ds_policy">Mapping Semantics::Data Types as a Policy
</a>.
26 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/basic_multimap.cc"><tt>basic_multimap.cc
</tt></a>- Basic use of
"multimaps
".
28 <a href =
"ms_gen.html#ds_policy">Mapping Semantics::Data Types as a Policy
</a>.
30 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/erase_if.cc"><tt>erase_if.cc
</tt></a>- Conditionally
31 erasing values from a container object.
33 <a href =
"motivation.html#methods">Motivation::Choice of Methods
</a>.
39 <h2><a name =
"generics">Generics
</a></h2>
42 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/ds_traits.cc"><tt>ds_traits.cc
</tt></a>-
44 <a href =
"ds_traits.html"><tt>ds_traits
</tt></a> to query about underlying
45 data-structure behaviour.
47 <a href =
"ds_gen.html#ds_traits">Data-Structure Genericity::Data-Structure Tags and Traits
</a>.
49 <li> <a href =
"../../../../testsuite/ext/pb_assoc/example/mapping_level.cc"><tt>mapping_level.cc
</tt></a>-
50 Rebinding a compound associative-container to different mapping levels.
52 <a href =
"ms_gen.html#mapping_level">Mapping-Semantics::Mapping Levels
</a>.
54 <li> <a href =
"../../../../testsuite/ext/pb_assoc/example/ms_traits.cpp"><tt>ms_traits.cpp
</tt></a>-
55 Using
<a href =
"ms_traits.html"><tt>ms_traits
</tt></a>
56 to query about mapping semantics.
58 <a href =
"ms_gen.html#ms_traits">Mapping-Semantics::Tags and Traits
</a>.
60 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/cc_ht_extract_key.cc"><tt>cc_ht_extract_key.cc
</tt></a>-
61 Extracting the key from different types.
66 <h2><a name =
"hash_based">Hash-Based Containers
</a></h2>
70 <a href =
"hash_based_containers.html">Hash-Based Containers
</a>.
77 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_bad_find.cc"><tt>hash_bad_find.cc
</tt></a>-
78 A non-compiling example showing wrong use of finding keys in hash-based
81 <a href =
"ds_gen.html#find_range">Data-Structure Genericity::Find-Type and Range-Type Methods and Iterators
</a>.
86 <h3>Resize-Related
</h3>
89 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_based_containers.html#resize_policies">Hash-Based Containers::Resize Policies
</a>.
94 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_initial_size.cc"><tt>hash_initial_size.cc
</tt></a>-
95 Setting the initial size of a hash-based container object.
98 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_bad_resize.cc"><tt>hash_bad_resize.cc
</tt></a>-
99 A non-compiling example showing how not to resize a hash-based container object.
102 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_resize.cc"><tt>hash_resize.cc
</tt></a>-
103 Resizing the size of a hash-based container object.
105 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/hash_illegal_resize.cc"><tt>hash_illegal_resize.cc
</tt></a>-
106 Showing an illegal resize of a hash-based container object.
109 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_load_set_change.cc"><tt>hash_load_set_change.cc
</tt></a>-
110 Changing the load factors of a hash-based container object.
115 <h3>Hash-Related
</h3>
118 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_based_containers.html#hash_policies">Hash-Based Containers::Hash Policies
</a>.
123 <a href =
"../../../../testsuite/ext/pb_assoc/example/hash_mod.cc"><tt>hash_mod.cc
</tt></a>-
124 Using a modulo range-hashing function.
127 <a href =
"../../../../testsuite/ext/pb_assoc/example/store_hash.cc"><tt>store_hash.cc
</tt></a>-
128 Storing the hash value along with each key.
131 <a href =
"../../../../testsuite/ext/pb_assoc/example/shift_mask.cc"><tt>shift_mask.cc
</tt></a>-
132 Writing a range-hashing functor.
134 <li><a href =
"../../../../testsuite/ext/pb_assoc/example/ranged_hash.cc"><tt>ranged_hash.cc
</tt></a>-
136 a ranged-hash functor.
</li>
143 <h2><a name =
"tree_based">Tree-Based Containers
</a></h2>
147 <a href =
"tree_based_containers.html">Tree-Based Containers
</a>.
150 <h3>Node-Invariatns
</h3>
154 <a href =
"tree_based_containers.html#invariants">Tree-Based Containers::Node Invariants
</a>.
158 <li><a href=
"../../../../testsuite/ext/pb_assoc/example/tree_order_statistics.cc"><tt>tree_order_statistics.cc
</tt></a>-
159 Using trees for order statistics.
161 <li><a href=
"../../../../testsuite/ext/pb_assoc/example/tree_intervals.cc"><tt>tree_intervals.cc
</tt></a>- Augmenting an
162 <a href =
"ov_tree_set.html"><tt>ov_tree_set
</tt></a>
163 to support operations on line intervals.
167 <h3>Split and Join
</h3>
171 <a href =
"tree_based_containers.html#add_methods">Tree-Based Containers::Additional Types and Methods
</a>.
175 <li><a href=
"../../../../testsuite/ext/pb_assoc/example/tree_join.cc"><tt>tree_join.cc
</tt></a>- Joining
176 two tree-based container objects.
178 <li><a href=
"../../../../testsuite/ext/pb_assoc/example/tree_split.cc"><tt>tree_split.cc
</tt></a>- Splitting
179 a tree-based container object.
181 <li><a href=
"../../../../testsuite/ext/pb_assoc/example/tree_order_statistics_join.cc"><tt>tree_order_statistics_join.cc
</tt></a>- Order statistics while joining two tree-based container objects.