xref: /openbsd-src/gnu/gcc/libstdc++-v3/docs/html/ext/pb_ds/assoc_examples.html (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2*404b540aSrobert    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3*404b540aSrobert
4*404b540aSrobert<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5*404b540aSrobert<head>
6*404b540aSrobert  <meta name="generator" content=
7*404b540aSrobert  "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
8*404b540aSrobert
9*404b540aSrobert  <title>Examples</title>
10*404b540aSrobert  <meta http-equiv="Content-Type" content=
11*404b540aSrobert  "text/html; charset=us-ascii" />
12*404b540aSrobert  </head>
13*404b540aSrobert
14*404b540aSrobert<body>
15*404b540aSrobert  <div id="page">
16*404b540aSrobert    <h1>Associative-Container Examples</h1>
17*404b540aSrobert
18*404b540aSrobert    <h2><a name="basic_usage" id="basic_usage">Basic Use</a></h2>
19*404b540aSrobert
20*404b540aSrobert    <ol>
21*404b540aSrobert      <li><a href=
22*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/basic_map.cc"><tt>basic_map.cc</tt></a>
23*404b540aSrobert      Basic use of "maps".</li>
24*404b540aSrobert
25*404b540aSrobert      <li><a href=
26*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/basic_set.cc"><tt>basic_set.cc</tt></a>
27*404b540aSrobert      Basic use of "sets".</li>
28*404b540aSrobert
29*404b540aSrobert      <li><a href=
30*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/erase_if.cc"><tt>erase_if.cc</tt></a>
31*404b540aSrobert      Conditionally erasing values from a container object.</li>
32*404b540aSrobert    </ol>
33*404b540aSrobert
34*404b540aSrobert    <h2><a name="generics" id="generics">Generics</a></h2>
35*404b540aSrobert
36*404b540aSrobert    <ol>
37*404b540aSrobert      <li><a href=
38*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/assoc_container_traits.cc"><tt>assoc_container_traits.cc</tt></a>
39*404b540aSrobert      Using <a href=
40*404b540aSrobert      "assoc_container_traits.html"><tt>container_traits</tt></a> to query
41*404b540aSrobert      about underlying data structure behavior.</li>
42*404b540aSrobert
43*404b540aSrobert      <li><a href=
44*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_find_neg.cc"><tt>hash_find_neg.cc</tt></a>
45*404b540aSrobert      A non-compiling example showing wrong use of finding keys in
46*404b540aSrobert      hash-based containers.</li>
47*404b540aSrobert    </ol>
48*404b540aSrobert
49*404b540aSrobert    <h2><a name="hash_based" id="hash_based">Hash-Based
50*404b540aSrobert    Containers</a></h2>
51*404b540aSrobert
52*404b540aSrobert
53*404b540aSrobert    <h3><a name="resize_related" id="resize_related">Resize
54*404b540aSrobert    Related</a></h3>
55*404b540aSrobert
56*404b540aSrobert
57*404b540aSrobert    <ol>
58*404b540aSrobert      <li><a href=
59*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_initial_size.cc"><tt>hash_initial_size.cc</tt></a>
60*404b540aSrobert      Setting the initial size of a hash-based container
61*404b540aSrobert      object.</li>
62*404b540aSrobert
63*404b540aSrobert      <li><a href=
64*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_resize_neg.cc"><tt>hash_resize_neg.cc</tt></a>
65*404b540aSrobert      A non-compiling example showing how not to resize a
66*404b540aSrobert      hash-based container object.</li>
67*404b540aSrobert
68*404b540aSrobert      <li><a href=
69*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_resize.cc"><tt>hash_resize.cc</tt></a>
70*404b540aSrobert      Resizing the size of a hash-based container object.</li>
71*404b540aSrobert
72*404b540aSrobert      <li><a href=
73*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_illegal_resize.cc"><tt>hash_illegal_resize.cc</tt></a>
74*404b540aSrobert      Showing an illegal resize of a hash-based container
75*404b540aSrobert      object.</li>
76*404b540aSrobert
77*404b540aSrobert      <li><a href=
78*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_load_set_change.cc"><tt>hash_load_set_change.cc</tt></a>
79*404b540aSrobert      Changing the load factors of a hash-based container
80*404b540aSrobert      object.</li>
81*404b540aSrobert    </ol>
82*404b540aSrobert
83*404b540aSrobert    <h3><a name="hash_related" id="hash_related">Hash-Function
84*404b540aSrobert    Related</a></h3>
85*404b540aSrobert
86*404b540aSrobert
87*404b540aSrobert    <ol>
88*404b540aSrobert      <li><a href=
89*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_mod.cc"><tt>hash_mod.cc</tt></a>
90*404b540aSrobert      Using a modulo range-hashing function for the case of an
91*404b540aSrobert      unknown skewed key distribution.</li>
92*404b540aSrobert
93*404b540aSrobert      <li><a href=
94*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/hash_shift_mask.cc"><tt>shift_mask.cc</tt></a>
95*404b540aSrobert      Writing a range-hashing functor for the case of a known
96*404b540aSrobert      skewed key distribution.</li>
97*404b540aSrobert
98*404b540aSrobert      <li><a href=
99*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/store_hash.cc"><tt>store_hash.cc</tt></a>
100*404b540aSrobert      Storing the hash value along with each key.</li>
101*404b540aSrobert
102*404b540aSrobert      <li><a href=
103*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/ranged_hash.cc"><tt>ranged_hash.cc</tt></a>
104*404b540aSrobert      Writing a ranged-hash functor.</li>
105*404b540aSrobert    </ol>
106*404b540aSrobert
107*404b540aSrobert    <h2><a name="tree_like_based" id=
108*404b540aSrobert    "tree_like_based">Tree-Like Containers (Trees and
109*404b540aSrobert    Tries)</a></h2>
110*404b540aSrobert
111*404b540aSrobert
112*404b540aSrobert    <h3><a name="node_invariants" id=
113*404b540aSrobert    "node_invariants">Node-Invariants</a></h3>
114*404b540aSrobert
115*404b540aSrobert
116*404b540aSrobert    <ol>
117*404b540aSrobert      <li><a href=
118*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/tree_order_statistics.cc"><tt>tree_order_statistics.cc</tt></a>
119*404b540aSrobert      Using trees for order statistics.</li>
120*404b540aSrobert
121*404b540aSrobert      <li><a href=
122*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/tree_intervals.cc"><tt>tree_intervals.cc</tt></a>
123*404b540aSrobert      Augmenting trees to support operations on line
124*404b540aSrobert      intervals.</li>
125*404b540aSrobert    </ol>
126*404b540aSrobert
127*404b540aSrobert    <h3><a name="split_join" id="split_join">Split and
128*404b540aSrobert    Join</a></h3>
129*404b540aSrobert
130*404b540aSrobert
131*404b540aSrobert    <ol>
132*404b540aSrobert      <li><a href=
133*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/tree_join.cc"><tt>tree_join.cc</tt></a>
134*404b540aSrobert      Joining two tree-based container objects.</li>
135*404b540aSrobert
136*404b540aSrobert      <li><a href=
137*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/trie_split.cc"><tt>trie_split.cc</tt></a>
138*404b540aSrobert      Splitting a PATRICIA trie container object.</li>
139*404b540aSrobert
140*404b540aSrobert      <li><a href=
141*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/tree_order_statistics_join.cc"><tt>tree_order_statistics_join.cc</tt></a>
142*404b540aSrobert      Order statistics while joining two tree-based container
143*404b540aSrobert      objects.</li>
144*404b540aSrobert    </ol>
145*404b540aSrobert
146*404b540aSrobert    <h2><a name="trie_based" id="trie_based">Trie-Based
147*404b540aSrobert    Containers</a></h2>
148*404b540aSrobert
149*404b540aSrobert
150*404b540aSrobert    <ol>
151*404b540aSrobert      <li><a href=
152*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/trie_dna.cc"><tt>trie_dna.cc</tt></a>
153*404b540aSrobert      Using a PATRICIA trie for DNA strings.</li>
154*404b540aSrobert
155*404b540aSrobert      <li><a href=
156*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/trie_prefix_search.cc"><tt>trie_prefix_search.cc</tt></a>
157*404b540aSrobert      Using a PATRICIA trie for finding all entries whose key
158*404b540aSrobert      matches a given prefix.</li>
159*404b540aSrobert    </ol>
160*404b540aSrobert
161*404b540aSrobert    <h2><a name="mmaps" id="mmaps">"Multimaps" and
162*404b540aSrobert    "Multisets".</a></h2>
163*404b540aSrobert    <ol>
164*404b540aSrobert      <li><a href=
165*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/basic_multimap.cc"><tt>basic_multimap.cc</tt></a>
166*404b540aSrobert      Basic use of "multimaps".</li>
167*404b540aSrobert
168*404b540aSrobert      <li><a href=
169*404b540aSrobert      "../../../../testsuite/ext/pb_ds/example/basic_multiset.cc"><tt>basic_multiset.cc</tt></a>
170*404b540aSrobert      Basic use of "multisets".</li>
171*404b540aSrobert    </ol>
172*404b540aSrobert  </div>
173*404b540aSrobert</body>
174*404b540aSrobert</html>
175