1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
4 <TITLE>Short Tutorial
</TITLE>
5 <META NAME=
"Generator" content=
"Microsoft Visual Studio .NET 7.1">
6 <base target =
"content">
9 <H1>Short Tutorial
</H1>
12 Following is a short tutorial introducing the main points of
<tt>pb_assoc
</tt>. It
13 is organized as follows.
</p>
15 <li><a href =
"#general_use">Basic Use of Maps
</a></li>
24 <h2><a name =
"general_use">Basic Use of Maps
</a></h2>
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.
31 <a href =
"cc_hash_assoc_cntnr.html">cc_hash_assoc_cntnr
</a><<b>int
</b>,
<b>char
</b>> c;
35 assert(c.find(
1) == c.end());
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>
44 <h2><a name =
"ms">Other Mapping Semantics
</a></h2>
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.
52 Instantiating the
<tt>Data
</tt> parameter by
53 <a href =
"null_data_type.html"><tt>null_data_type
</tt></a>
54 makes a
"set
". For example, the following shows a collision-chaining container storing integers.
57 <a href =
"cc_hash_assoc_cntnr.html">cc_hash_assoc_cntnr
</a><<b>int
</b>,
<a href =
"null_data_type.html">null_data_type
</a>> c;
61 assert(c.find(
1) == c.end());