Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libstdc++-v3 / docs / html / ext / pb_assoc / tutorial.html
blobb5dd0f512655cbb02ff8f3cbe39ddda1c6b27ddc
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>Short Tutorial</TITLE>
5 <META NAME="Generator" content="Microsoft Visual Studio .NET 7.1">
6 <base target = "content">
7 </HEAD>
8 <BODY>
9 <H1>Short Tutorial</H1>
11 <p>
12 Following is a short tutorial introducing the main points of <tt>pb_assoc</tt>. It
13 is organized as follows.</p>
14 <ol>
15 <li><a href = "#general_use">Basic Use of Maps</a></li>
16 </ol>
24 <h2><a name = "general_use">Basic Use of Maps</a></h2>
26 <p>
27 For the greater part, using <tt>pb_assoc</tt>'s maps is similar
28 to using those of the STL. For example, the following shows a collision-chaining container mapping integers to characters.
30 <pre>
31 <a href = "cc_hash_assoc_cntnr.html">cc_hash_assoc_cntnr</a>&lt;<b>int</b>, <b>char</b>&gt; c;
33 c[2] = 'b';
35 assert(c.find(1) == c.end());
36 </pre>
38 <p>
39 <a href="interface.html#containers">Inteface::Containers</a> describes the containers supported. <a href = "../example/basic_map_example.cpp"><tt>basic_map_example.cpp</tt></a>
40 shows an example.
41 </p>
44 <h2><a name = "ms">Other Mapping Semantics</a></h2>
46 <p>
47 <tt>pb_assoc</tt> does not contain separate containers for different mapping semantics,
48 as the STL does (<i>e.g.</i>, <tt>std::map</tt> and <tt>std::multimap</tt>). Rather, containers are parameterized by a <tt>Data</tt> parameter, and this parameter is a policy for the mapping semantics.
49 </p>
51 <p>
52 Instantiating the <tt>Data</tt> parameter by
53 <a href = "null_data_type.html"><tt>null_data_type</tt></a>
54 makes a &quot;set&quot;. For example, the following shows a collision-chaining container storing integers.
56 <pre>
57 <a href = "cc_hash_assoc_cntnr.html">cc_hash_assoc_cntnr</a>&lt;<b>int</b>, <a href = "null_data_type.html">null_data_type</a>&gt; c;
59 c.insert(2);
61 assert(c.find(1) == c.end());
62 </pre>
63 </p>
65 </BODY>
66 </HTML>