Boost logo

Boost-Commit :

From: matias.capeletto_at_[hidden]
Date: 2008-02-04 16:01:06


Author: matias
Date: 2008-02-04 16:01:06 EST (Mon, 04 Feb 2008)
New Revision: 43103
URL: http://svn.boost.org/trac/boost/changeset/43103

Log:
hooking --> additional information in html docs
Added:
   trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/additional_information.html (contents, props changed)
Removed:
   trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/hooking_information.html

Added: trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/additional_information.html
==============================================================================
--- (empty file)
+++ trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/additional_information.html 2008-02-04 16:01:06 EST (Mon, 04 Feb 2008)
@@ -0,0 +1,249 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Additional
+ information</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Bimap">
+<link rel="up" href="../the_tutorial.html" title="The tutorial">
+<link rel="prev" href="unconstrained_sets.html" title="Unconstrained
+ Sets">
+<link rel="next" href="complete_instantiation_scheme.html" title="Complete
+ instantiation scheme">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="unconstrained_sets.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../the_tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="complete_instantiation_scheme.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_bimap.the_tutorial.additional_information"></a><a href="additional_information.html" title="Additional
+ information">Additional
+ information</a>
+</h3></div></div></div>
+<p>
+ Bidirectional maps may have associated information about each relation. Suppose
+ we want to represent a books and author bidirectional map.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="keyword">typedef</span> <span class="identifier">bimap</span><span class="special">&lt;</span>
+
+ <span class="identifier">multiset_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// author
+</span> <span class="identifier">set_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="comment">// title
+</span>
+<span class="special">&gt;</span> <span class="identifier">bm_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">book</span><span class="special">;</span>
+
+<span class="identifier">bm_type</span> <span class="identifier">bm</span><span class="special">;</span>
+
+<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Bjarne Stroustrup"</span> <span class="special">,</span> <span class="string">"The C++ Programming Language"</span> <span class="special">)</span> <span class="special">);</span>
+<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Scott Meyers"</span> <span class="special">,</span> <span class="string">"Effective C++"</span> <span class="special">)</span> <span class="special">);</span>
+<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Andrei Alexandrescu"</span> <span class="special">,</span> <span class="string">"Modern C++ Design"</span> <span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// Print the author of Modern C++
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span> <span class="string">"Modern C++ Design"</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Suppose now that we want to store abstract of each book. We have two options:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ Books name are unique identifiers, so we can create a separate <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span> <span class="identifier">string</span><span class="special">,</span> <span class="identifier">string</span> <span class="special">&gt;</span></code>
+ that relates books names with abstracts.
+ </li>
+<li>
+ We can use Boost.MultiIndex for the new beast.
+ </li>
+</ol></div>
+<p>
+ Option 1 is the wrong approach, if we go this path we lost what bimap has
+ won us. We now have to maintain the logic of two interdependent containers,
+ there is an extra string stored for each book name, and the performance will
+ be worse. This is far away from being a good solution.
+ </p>
+<p>
+ Option 2 is correct. We start thinking books as entries in a table. So it
+ makes sense to start using Boost.MultiIndex. We can then add the year of
+ publication, the price, etc... and we can index this new items too. So Boost.MultiIndex
+ is a sound solution for our problem.
+ </p>
+<p>
+ The thing is that there are cases where we want to maintain bimap semantics
+ (use <code class="computeroutput"><span class="identifier">at</span><span class="special">()</span></code>
+ to find an author given a book name and the other way around) and add information
+ about the relations that we are sure we will not want to index later (like
+ the abstracts). Option 1 is not possible, option 2 neither.
+ </p>
+<p>
+ Boost.Bimap provides support for this kind of situations by means of an embedded
+ information member. You can pass an extra parameter to a bimap: <code class="computeroutput"><span class="identifier">with_info</span><span class="special">&lt;</span>
+ <span class="identifier">InfoType</span> <span class="special">&gt;</span></code>
+ and an <code class="computeroutput"><span class="identifier">info</span></code> member of type
+ <code class="computeroutput"><span class="identifier">InfoType</span></code> will appear in the
+ relation and bimap pairs.
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../../images/bimap/relation.and.pair.with.info.png" alt="relation.and.pair.with.info"></span>
+ </p>
+<p>
+ Relations and bimap pairs constructors will take an extra argument. If only
+ two arguments are used, the information will be initialized with their default
+ constructor.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="keyword">typedef</span> <span class="identifier">bimap</span><span class="special">&lt;</span>
+
+ <span class="identifier">multiset_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// author
+</span> <span class="identifier">set_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// title
+</span>
+ <span class="identifier">with_info</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="comment">// abstract
+</span>
+<span class="special">&gt;</span> <span class="identifier">bm_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">book</span><span class="special">;</span>
+
+<span class="identifier">bm_type</span> <span class="identifier">bm</span><span class="special">;</span>
+
+<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span>
+
+ <span class="identifier">book</span><span class="special">(</span> <span class="string">"Bjarne Stroustrup"</span> <span class="special">,</span> <span class="string">"The C++ Programming Language"</span><span class="special">,</span>
+
+ <span class="string">"For C++ old-timers, the first edition of this book is"</span>
+ <span class="string">"the one that started it all&#8212;the font of our knowledge."</span> <span class="special">)</span>
+<span class="special">);</span>
+
+
+<span class="comment">// Print the author of the bible
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
+
+<span class="comment">// Print the abstract of this book
+</span><span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">left_iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">left</span><span class="special">.</span><span class="identifier">find</span><span class="special">(</span><span class="string">"Bjarne Stroustrup"</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">info</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Contrary to the two key types, the information will be mutable using iterators.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">info</span> <span class="special">+=</span> <span class="string">"More details about this book"</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ A new function is included in <span class="emphasis"><em>unique</em></span> map views: <code class="computeroutput"><span class="identifier">info_at</span><span class="special">(</span><span class="identifier">key</span><span class="special">)</span></code>, that
+ mimics the standard <code class="computeroutput"><span class="identifier">at</span><span class="special">(</span><span class="identifier">key</span><span class="special">)</span></code> function
+ but returned the associated information instead of the data.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="comment">// Print the new abstract
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">info_at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The info member can be tagged just as the left or the right member. The following
+ is a rewrite of the above example using user defined names:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="keyword">typedef</span> <span class="identifier">bimap</span><span class="special">&lt;</span>
+
+ <span class="identifier">multiset_of</span><span class="special">&lt;</span> <span class="identifier">tagged</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">author</span> <span class="special">&gt;</span> <span class="special">&gt;,</span>
+ <span class="identifier">set_of</span><span class="special">&lt;</span> <span class="identifier">tagged</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">title</span> <span class="special">&gt;</span> <span class="special">&gt;,</span>
+
+ <span class="identifier">with_info</span><span class="special">&lt;</span> <span class="identifier">tagged</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">abstract</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
+
+<span class="special">&gt;</span> <span class="identifier">bm_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">book</span><span class="special">;</span>
+
+<span class="identifier">bm_type</span> <span class="identifier">bm</span><span class="special">;</span>
+
+<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span>
+
+ <span class="identifier">book</span><span class="special">(</span> <span class="string">"Bjarne Stroustrup"</span> <span class="special">,</span> <span class="string">"The C++ Programming Language"</span><span class="special">,</span>
+
+ <span class="string">"For C++ old-timers, the first edition of this book is"</span>
+ <span class="string">"the one that started it all&#8212;the font of our knowledge."</span> <span class="special">)</span>
+<span class="special">);</span>
+
+<span class="comment">// Print the author of the bible
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">by</span><span class="special">&lt;</span><span class="identifier">title</span><span class="special">&gt;().</span><span class="identifier">at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
+
+<span class="comment">// Print the abstract of this book
+</span><span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">map_by</span><span class="special">&lt;</span><span class="identifier">author</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">by</span><span class="special">&lt;</span><span class="identifier">author</span><span class="special">&gt;().</span><span class="identifier">find</span><span class="special">(</span><span class="string">"Bjarne Stroustrup"</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">&lt;</span><span class="identifier">abstract</span><span class="special">&gt;();</span>
+
+<span class="comment">// Contrary to the two key types, the information will be mutable
+</span><span class="comment">// using iterators.
+</span>
+<span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">&lt;</span><span class="identifier">abstract</span><span class="special">&gt;()</span> <span class="special">+=</span> <span class="string">"More details about this book"</span><span class="special">;</span>
+
+<span class="comment">// Print the new abstract
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">by</span><span class="special">&lt;</span><span class="identifier">title</span><span class="special">&gt;().</span><span class="identifier">info_at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Go to source code
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2006 -2007 Matias Capeletto<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="unconstrained_sets.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../the_tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="complete_instantiation_scheme.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Deleted: trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/hooking_information.html
==============================================================================
--- trunk/libs/bimap/doc/html/boost_bimap/the_tutorial/hooking_information.html 2008-02-04 16:01:06 EST (Mon, 04 Feb 2008)
+++ (empty file)
@@ -1,221 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Hooking
- Information</title>
-<link rel="stylesheet" href="../../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
-<link rel="start" href="../../index.html" title="Chapter 1. Boost.Bimap">
-<link rel="up" href="../the_tutorial.html" title="The tutorial">
-<link rel="prev" href="unconstrained_sets.html" title="Unconstrained
- Sets">
-<link rel="next" href="complete_instantiation_scheme.html" title="Complete
- instantiation scheme">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%">
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
-<td align="center">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="unconstrained_sets.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../the_tutorial.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="complete_instantiation_scheme.html"><img src="../../images/next.png" alt="Next"></a>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_bimap.the_tutorial.hooking_information"></a><a href="hooking_information.html" title="Hooking
- Information">Hooking
- Information</a>
-</h3></div></div></div>
-<p>
- Bidirectional maps may have associated information about each relation. Suppose
- we want to represent a books and author bidirectional map.
- </p>
-<p>
- </p>
-<p>
-
-</p>
-<pre class="programlisting">
-<span class="keyword">typedef</span> <span class="identifier">bimap</span><span class="special">&lt;</span>
-
- <span class="identifier">multiset_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// author
-</span> <span class="identifier">set_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="comment">// book name
-</span>
-<span class="special">&gt;</span> <span class="identifier">bm_type</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">book</span><span class="special">;</span>
-
-<span class="identifier">bm_type</span> <span class="identifier">bm</span><span class="special">;</span>
-
-<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Bjarne Stroustrup"</span> <span class="special">,</span> <span class="string">"The C++ Programming Language"</span> <span class="special">)</span> <span class="special">);</span>
-<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Scott Meyers"</span> <span class="special">,</span> <span class="string">"Effective C++"</span> <span class="special">)</span> <span class="special">);</span>
-<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> <span class="identifier">book</span><span class="special">(</span> <span class="string">"Andrei Alexandrescu"</span> <span class="special">,</span> <span class="string">"Modern C++ Design"</span> <span class="special">)</span> <span class="special">);</span>
-
-<span class="comment">// Print the author of Modern C++
-</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span> <span class="string">"Modern C++ Design"</span> <span class="special">);</span>
-</pre>
-<p>
- </p>
-<p>
- </p>
-<p>
- </p>
-<div class="calloutlist"><table border="0" summary="Callout list"></table></div>
-<p>
- </p>
-<p>
- </p>
-<p>
- Suppose now that we want to store abstract of each book. We have two options:
- </p>
-<div class="orderedlist"><ol type="1">
-<li>
- Books name are unique identifiers, so we can create a separate <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span> <span class="identifier">string</span><span class="special">,</span> <span class="identifier">string</span> <span class="special">&gt;</span></code>
- that relates books names with abstracts.
- </li>
-<li>
- We can use Boost.MultiIndex for the new beast.
- </li>
-</ol></div>
-<p>
- Option 1 is the wrong approach, if we go this path we lost what bimap has
- won us. We now have to maintain the logic of two interdependent containers,
- there is an extra string stored for each book name, and the performance will
- be worse. This is far away from being a good solution.
- </p>
-<p>
- Option 2 is correct. We start thinking books as entries in a table. So it
- makes sense to start using Boost.MultiIndex. We can then add the year of
- publication, the price, etc... and we can index this new items too. So Boost.MultiIndex
- is a sound solution for our problem.
- </p>
-<p>
- The thing is that there are cases where we want to maintain bimap semantics
- (use <code class="computeroutput"><span class="identifier">at</span><span class="special">()</span></code>
- to find an author given a book name and the other way around) and add information
- about the relations that we are sure we will not want to index later (like
- the abstracts). Option 1 is not possible, option 2 neither.
- </p>
-<p>
- Boost.Bimap provides support for this kind of situations by means of information
- hooking. You can pass an extra parameter to a bimap with the type <code class="computeroutput"><span class="identifier">info_hook</span><span class="special">&lt;</span>
- <span class="identifier">InfoType</span> <span class="special">&gt;</span></code>
- and an <code class="computeroutput"><span class="identifier">info</span></code> member of type
- <code class="computeroutput"><span class="identifier">InfoType</span></code> will appear in the
- relation and bimap pairs.
- </p>
-<p>
- Relations and bimap pairs constructors can take an extra argument. If only
- two arguments are used, the information will be initialized with their default
- constructor.
- </p>
-<p>
- </p>
-<p>
-
-</p>
-<pre class="programlisting">
-<span class="keyword">typedef</span> <span class="identifier">bimap</span><span class="special">&lt;</span>
-
- <span class="identifier">multiset_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// author
-</span> <span class="identifier">set_of</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;,</span> <span class="comment">// book name
-</span>
- <span class="identifier">with_info</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="comment">// abstract
-</span>
-<span class="special">&gt;</span> <span class="identifier">bm_type</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">book</span><span class="special">;</span>
-
-<span class="identifier">bm_type</span> <span class="identifier">bm</span><span class="special">;</span>
-
-<span class="identifier">bm</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span>
-
- <span class="identifier">book</span><span class="special">(</span> <span class="string">"Bjarne Stroustrup"</span> <span class="special">,</span> <span class="string">"The C++ Programming Language"</span><span class="special">,</span>
-
- <span class="string">"For C++ old-timers, the first edition of this book is"</span>
- <span class="string">"the one that started it all&#8212;the font of our knowledge."</span> <span class="special">)</span>
-<span class="special">);</span>
-
-
-<span class="comment">// Print the abstract of the bible
-</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
-
-<span class="comment">// Print the abstract of this book
-</span><span class="identifier">bm_type</span><span class="special">::</span><span class="identifier">left_iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">left</span><span class="special">.</span><span class="identifier">find</span><span class="special">(</span><span class="string">"Bjarne Stroustrup"</span><span class="special">);</span>
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">info</span><span class="special">;</span>
-</pre>
-<p>
- </p>
-<p>
- </p>
-<p>
- </p>
-<div class="calloutlist"><table border="0" summary="Callout list"></table></div>
-<p>
- </p>
-<p>
- </p>
-<p>
- Contrary to the two key types, the information will be mutable using iterators.
- </p>
-<p>
- </p>
-<p>
-
-</p>
-<pre class="programlisting">
-<span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">info</span> <span class="special">+=</span> <span class="string">"More details about this book"</span><span class="special">;</span>
-</pre>
-<p>
- </p>
-<p>
- </p>
-<p>
- </p>
-<div class="calloutlist"><table border="0" summary="Callout list"></table></div>
-<p>
- </p>
-<p>
- </p>
-<p>
- A new function is included in <span class="emphasis"><em>unique</em></span> map views: <code class="computeroutput"><span class="identifier">info_at</span><span class="special">(</span><span class="identifier">key</span><span class="special">)</span></code>, that
- mimics the standard <code class="computeroutput"><span class="identifier">at</span><span class="special">(</span><span class="identifier">key</span><span class="special">)</span></code> function
- but returned the associated information instead of the data.
- </p>
-<p>
- </p>
-<p>
-
-</p>
-<pre class="programlisting">
-<span class="comment">// Print the new abstract
-</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bm</span><span class="special">.</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">info_at</span><span class="special">(</span><span class="string">"The C++ Programming Language"</span><span class="special">);</span>
-</pre>
-<p>
- </p>
-<p>
- </p>
-<p>
- </p>
-<div class="calloutlist"><table border="0" summary="Callout list"></table></div>
-<p>
- </p>
-<p>
- </p>
-<p>
- Go to source code
- </p>
-</div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"></td>
-<td align="right"><small>Copyright © 2006 -2007 Matias Capeletto</small></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="unconstrained_sets.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../the_tutorial.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="complete_instantiation_scheme.html"><img src="../../images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk