Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66512 - in sandbox/statistics/support/libs/assign/v2/doc/html: . boost_assign_v2 boost_assign_v2/users_guide
From: erwann.rogard_at_[hidden]
Date: 2010-11-11 22:03:26


Author: e_r
Date: 2010-11-11 22:03:24 EST (Thu, 11 Nov 2010)
New Revision: 66512
URL: http://svn.boost.org/trac/boost/changeset/66512

Log:
m
Added:
   sandbox/statistics/support/libs/assign/v2/doc/html/
   sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/
   sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/
   sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide.html (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/anonymous_container_of_references.html (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/working_assumptions.html (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/doc/html/index.html (contents, props changed)

Added: sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide.html
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide.html 2010-11-11 22:03:24 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,254 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>User's guide</title>
+<link rel="stylesheet" href="..//usr/local/trunk/libs/assign/v2/doc/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<link rel="prev" href="../index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<link rel="next" href="users_guide/working_assumptions.html" title="Working assumptions">
+</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="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="users_guide/working_assumptions.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="User's guide">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_assign_v2.users_guide"></a><a class="link" href="users_guide.html" title="User's guide"> User's guide</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Notation</span></dt>
+<dt><span class="section"><a href="users_guide/working_assumptions.html">Working
+ assumptions</a></span></dt>
+<dt><span class="section"><a href="users_guide/anonymous_container_of_references.html">Anonymous
+ container of references</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="users_guide/anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_copy">Assign
+ copy</a></span></dt>
+<dt><span class="section"><a href="users_guide/anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_rebind">Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="users_guide/anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.the_functor_interface">The
+ functor interface</a></span></dt>
+</dl></dd>
+</dl></div>
+<p>
+ This section describes the usage of the tools of this library. For specific
+ details, check the reference section.
+ </p>
+<p>
+ All the examples given therein are in the <code class="computeroutput"><span class="special">/</span><span class="identifier">libs</span><span class="special">/</span><span class="identifier">assign</span><span class="special">/</span><span class="identifier">v2</span><span class="special">/</span><span class="identifier">example</span><span class="special">/</span></code>
+ directory.
+ </p>
+<div class="section" title="Notation">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.users_guide.notation"></a><a class="link" href="users_guide.html#boost_assign_v2.users_guide.notation" title="Notation">Notation</a>
+</h3></div></div></div>
+<div class="table">
+<a name="boost_assign_v2.users_guide.notation.symbols"></a><p class="title"><b>Table&#160;1.1.&#160;Symbols</b></p>
+<div class="table-contents"><table class="table" summary="Symbols">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Symbol
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">cont</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A container
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A key
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">t</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A data
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">u</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A key data pair
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">arg</code>
+ </p>
+ </td>
+<td>
+ <p>
+ An argument to a function
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="table">
+<a name="boost_assign_v2.users_guide.notation.indexes"></a><p class="title"><b>Table&#160;1.2.&#160;Indexes</b></p>
+<div class="table-contents"><table class="table" summary="Indexes">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Expression
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">i</code> = 0, ..., <code class="literal">n</code>-1</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Indexes a sequences of <code class="computeroutput">t</code>'s
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">j</code> = 0, ..., <code class="literal">k</code>-1</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Indexes arguments associated with a <code class="computeroutput">t</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">k</code>[<code class="literal">i</code>] </code>
+ </p>
+ </td>
+<td>
+ <p>
+ Number of function arguments at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="computeroutput">arg</code>[<code class="literal">i</code>] </code>
+ </p>
+ </td>
+<td>
+ <p>
+ Set of arguments at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="computeroutput">arg</code>[<code class="literal">i</code>,<code class="literal">j</code>]</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">j</code> th argument at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal">a</code>[<code class="literal">i</code>] , <code class="literal">b</code>[<code class="literal">i</code>]
+ , <code class="literal">c</code>[<code class="literal">i</code>] etc.
+ </p>
+ </td>
+<td>
+ <p>
+ Shorthand for <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">0</code>],
+ <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">1</code>],
+ <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">2</code>]
+ etc.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+</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 &#169; 2003 -2004 Thorsten Ottosen, 2010 Erwann Rogard<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="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="users_guide/working_assumptions.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/anonymous_container_of_references.html
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/anonymous_container_of_references.html 2010-11-11 22:03:24 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,188 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Anonymous container of references</title>
+<link rel="stylesheet" href="../..//usr/local/trunk/libs/assign/v2/doc/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<link rel="up" href="../users_guide.html" title="User's guide">
+<link rel="prev" href="working_assumptions.html" title="Working assumptions">
+</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="working_assumptions.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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>
+</div>
+<div class="section" title="Anonymous container of references">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.users_guide.anonymous_container_of_references"></a><a class="link" href="anonymous_container_of_references.html" title="Anonymous container of references">Anonymous
+ container of references</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_copy">Assign
+ copy</a></span></dt>
+<dt><span class="section"><a href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_rebind">Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.the_functor_interface">The
+ functor interface</a></span></dt>
+</dl></div>
+<div class="section" title="Assign copy">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.users_guide.anonymous_container_of_references.assign_copy"></a><a class="link" href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_copy" title="Assign copy">Assign
+ copy</a>
+</h4></div></div></div>
+<p>
+ To work with references, the relevant <code class="computeroutput"><span class="keyword">namespace</span></code>
+ is <code class="computeroutput"><span class="identifier">ref</span></code>, but we also need
+ a nested <code class="computeroutput"><span class="keyword">namespace</span></code> that specifies
+ an assignment policy. For example,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">),</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+<span class="comment">//outputs (1,0)(NULL,0)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The result from <code class="computeroutput"><span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">()</span></code>
+ is more than just a range. It has much of the functionality of the static
+ array, boost::array<>,
+ such as <code class="computeroutput"><span class="identifier">assign</span><span class="special">()</span></code>,
+ as we now illustrate,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">x1</span><span class="special">,</span> <span class="identifier">y1</span><span class="special">,</span> <span class="identifier">z1</span><span class="special">;</span>
+<span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x1</span><span class="special">,</span> <span class="identifier">y1</span><span class="special">,</span> <span class="identifier">z1</span> <span class="special">).</span><span class="identifier">assign</span><span class="special">(</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">)</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">y1</span> <span class="special">==</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Here's how to create an empty array of <code class="computeroutput"><span class="keyword">const</span>
+ T</code> references:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">&lt;</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;(</span> <span class="identifier">_nil</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="Assign rebind">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.users_guide.anonymous_container_of_references.assign_rebind"></a><a class="link" href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.assign_rebind" title="Assign rebind">Assign
+ rebind</a>
+</h4></div></div></div>
+<p>
+ We now turn to the rebind assignment policy. Here, it will be necessary
+ to save the result:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_rebind</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result_</span><span class="special">;</span>
+<span class="identifier">result_</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">result</span><span class="special">[</span> <span class="number">1</span> <span class="special">]</span> <span class="special">==</span> <span class="special">&amp;</span><span class="identifier">y</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Thus far, the side effect would be the same under the <code class="computeroutput"><span class="identifier">assign_copy</span></code>
+ policy. The effect of assigning a new object to each element of our result,
+ however, is different:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">w</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">);</span> <span class="identifier">result</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span> <span class="identifier">w</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">result</span><span class="special">[</span> <span class="number">1</span> <span class="special">]</span> <span class="special">==</span> <span class="special">&amp;</span><span class="identifier">w</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="The functor interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.users_guide.anonymous_container_of_references.the_functor_interface"></a><a class="link" href="anonymous_container_of_references.html#boost_assign_v2.users_guide.anonymous_container_of_references.the_functor_interface" title="The functor interface">The
+ functor interface</a>
+</h4></div></div></div>
+<p>
+ The functor interface works as follows:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_rebind</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="number">2</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result1_</span><span class="special">;</span>
+<span class="identifier">result1_</span> <span class="identifier">result1</span> <span class="special">=</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">anon</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">)(</span> <span class="identifier">y</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ and <code class="computeroutput"><span class="identifier">result1</span></code> has all the
+ functionality of that resulting from <code class="computeroutput"><span class="identifier">csv_anon</span><span class="special">(</span>x<span class="special">,</span> y<span class="special">)</span></code>.
+ Unlike the latter, it's possible to append an element:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result2_</span><span class="special">;</span>
+<span class="identifier">result2_</span> <span class="identifier">result2</span> <span class="special">=</span> <span class="identifier">result1</span><span class="special">(</span> <span class="identifier">z</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Internally, <code class="computeroutput"><span class="identifier">result2</span></code> keeps
+ a reference to <code class="computeroutput"><span class="identifier">result1</span></code>,
+ and not until the boost::array<>
+ interface is called, as in
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">result2</span><span class="special">,</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ is a static array allocated, with reference wrappers, in this case, for
+ <code class="computeroutput">x</code>, <code class="computeroutput">y</code> and <code class="computeroutput">z</code>,
+ </p>
+</div>
+</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 &#169; 2003 -2004 Thorsten Ottosen, 2010 Erwann Rogard<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="working_assumptions.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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>
+</div>
+</body>
+</html>

Added: sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/working_assumptions.html
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/doc/html/boost_assign_v2/users_guide/working_assumptions.html 2010-11-11 22:03:24 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,174 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Working assumptions</title>
+<link rel="stylesheet" href="../..//usr/local/trunk/libs/assign/v2/doc/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<link rel="up" href="../users_guide.html" title="User's guide">
+<link rel="prev" href="../users_guide.html" title="User's guide">
+<link rel="next" href="anonymous_container_of_references.html" title="Anonymous container of references">
+</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="../users_guide.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="anonymous_container_of_references.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Working assumptions">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.users_guide.working_assumptions"></a><a class="link" href="working_assumptions.html" title="Working assumptions">Working
+ assumptions</a>
+</h3></div></div></div>
+<p>
+ Here we give some pieces of code that will be assumed throughout. The chosen
+ set up is such that, by appealing to deduction, a broad range of needs, including
+ the basic ones, are adressed. What we mean by a basic need, is filling a
+ container with <code class="computeroutput"><span class="keyword">int</span></code>s. What we
+ mean by a need that is at the complexity boundary of our set up, is working
+ with a collection of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span></code>s
+ of references.
+ </p>
+<p>
+ The first piece of code are include statements:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">utility</span><span class="special">&gt;</span> <span class="comment">// std::pair
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assert</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">range</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assign</span><span class="special">/</span><span class="identifier">v2</span><span class="special">/</span><span class="identifier">v2</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Next, we define a <code class="computeroutput"><span class="keyword">struct</span></code>, <code class="computeroutput"><span class="identifier">foo</span></code> :
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">foo</span>
+<span class="special">{</span>
+ <span class="identifier">foo</span><span class="special">():</span><span class="identifier">ptr_a</span><span class="special">(</span> <span class="number">0</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="number">0</span> <span class="special">){}</span>
+ <span class="identifier">foo</span><span class="special">(</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">ptr_a</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">a</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="number">0</span> <span class="special">){}</span>
+ <span class="identifier">foo</span><span class="special">(</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">b_</span><span class="special">):</span> <span class="identifier">ptr_a</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">a</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="identifier">b_</span> <span class="special">){}</span>
+
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">other</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">ptr_a</span> <span class="special">==</span> <span class="identifier">other</span><span class="special">.</span><span class="identifier">ptr_a</span><span class="special">)</span> <span class="special">&amp;&amp;</span> <span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">b</span> <span class="special">==</span> <span class="identifier">other</span><span class="special">.</span><span class="identifier">b</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">foo</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">delta</span><span class="special">){</span> <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">b</span> <span class="special">+=</span> <span class="identifier">delta</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">(*</span><span class="keyword">this</span><span class="special">);</span> <span class="special">}</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">friend</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">foo</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">);</span>
+ <span class="keyword">int</span><span class="special">*</span> <span class="identifier">ptr_a</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">b</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="keyword">struct</span> <span class="identifier">make_foo</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">foo</span> <span class="identifier">result_type</span><span class="special">;</span>
+ <span class="identifier">result_type</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">result_type</span><span class="special">(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&lt;&lt;(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+
+<span class="keyword">struct</span> <span class="identifier">printer</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">void</span> <span class="identifier">result_type</span><span class="special">;</span>
+
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os_</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">os</span><span class="special">(</span> <span class="identifier">os_</span> <span class="special">){}</span>
+
+ <span class="identifier">result_type</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">os</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">mutable</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ The exact definition of <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></code> can be found in the file foo.cpp
+ .
+ </p>
+<p>
+ Then come some dependent types,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">S</span><span class="special">;</span> <span class="comment">// key
+</span><span class="keyword">typedef</span> <span class="identifier">foo</span> <span class="identifier">T</span><span class="special">;</span> <span class="comment">// data
+</span><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">U</span><span class="special">;</span> <span class="comment">//key-data pair
+</span></pre>
+<p>
+ </p>
+<p>
+ and finally a set of constants :
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span><span class="special">{</span>
+
+<span class="keyword">int</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">=</span> <span class="number">5</span><span class="special">;</span>
+
+<span class="identifier">S</span> <span class="identifier">key_x</span> <span class="special">=</span> <span class="string">"x"</span> <span class="special">;</span>
+<span class="identifier">S</span> <span class="identifier">key_y</span> <span class="special">=</span> <span class="string">"y"</span> <span class="special">;</span>
+<span class="identifier">S</span> <span class="identifier">key_z</span> <span class="special">=</span> <span class="string">"z"</span> <span class="special">;</span>
+
+<span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">x</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">);</span> <span class="comment">// (1, 0)
+</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">y</span><span class="special">;</span> <span class="comment">// (NULL, 0)
+</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">z</span><span class="special">(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">);</span> <span class="comment">//(1, 5)
+</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ In terms of our notation, by seeing <code class="computeroutput">x</code>, <code class="computeroutput">y</code>, and
+ <code class="computeroutput">z</code> as forming a sequence, <code class="computeroutput">n <span class="special">=</span>
+ <span class="number">3</span></code>, <code class="computeroutput">k<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">1</span></code>, <code class="computeroutput">k<span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">0</span></code>, and <code class="computeroutput">k<span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">2</span></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 &#169; 2003 -2004 Thorsten Ottosen, 2010 Erwann Rogard<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="../users_guide.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_guide.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="anonymous_container_of_references.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/statistics/support/libs/assign/v2/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/doc/html/index.html 2010-11-11 22:03:24 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,3307 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Chapter&#160;1.&#160;Boost.Assign 2.0</title>
+<link rel="stylesheet" href="/usr/local/trunk/libs/assign/v2/doc/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+</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"></div>
+<div class="chapter" title="Chapter&#160;1.&#160;Boost.Assign 2.0">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="boost_assign_v2"></a>Chapter&#160;1.&#160;Boost.Assign 2.0</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Ottosen</span> <span class="surname">Thorsten</span>
+</h3></div></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Erwann</span> <span class="surname">Rogard</span>
+</h3></div></div>
+<div><p class="copyright">Copyright &#169; 2003 -2004 Thorsten Ottosen, 2010 Erwann Rogard</p></div>
+<div><div class="legalnotice" title="Legal Notice">
+<a name="id36154309"></a><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></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy"> Help with qbk : without this enclosing
+ section, the layout messes up! </a></span></dt>
+<dd><dl>
+<dt><span class="section">Preface</span></dt>
+<dt><span class="section"> User's guide</span></dt>
+<dd><dl>
+<dt><span class="section">Notation</span></dt>
+<dt><span class="section"> Working assumptions</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon"> Anonymous container
+ of references</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"> Assign copy</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.rebind"> Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.functor"> The functor
+ interface</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put"> Adaptors <code class="computeroutput"><span class="identifier">_csv_put</span></code> and <code class="computeroutput"><span class="identifier">_put</span></code>
+ </a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.usage"> Basic usage
+ </a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.std_modifier"> Standard
+ modifier</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding"> Argument
+ forwarding</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ptr_container"> Pointer
+ container</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ext_func"> Extended
+ functionality</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.test_knowledge"> Test
+ your knowledge</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.anon"> Anonymous container
+ of values</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _put_range</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _chain</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Conversion</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.conversion.anonymous_containers">Anonymous
+ containers</a></span></dt>
+<dt><span class="section">_chain adaptor</span></dt>
+<dt><span class="section">Inter-STL-categories</span></dt>
+</dl></dd>
+<dt><span class="section"> Configuring arity</span></dt>
+</dl></dd>
+<dt><span class="section">Reference</span></dt>
+<dt><span class="section">Runtime efficiency</span></dt>
+<dt><span class="section"> Testing platform</span></dt>
+<dt><span class="section">Portability</span></dt>
+<dt><span class="section">Dependencies</span></dt>
+<dt><span class="section">Change log</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__">[Proposal
+ for] Upgrading from Boost v<span class="emphasis"><em>1.4x</em></span>
+ to Boost.Assign 2.0</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization">The
+ new organization</a></span></dt>
+<dt><span class="section">Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface">The
+ new interface</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse">Code
+ reuse</a></span></dt>
+</dl></dd>
+</dl></dd>
+<dt><span class="section">Support</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement">History
+ and acknowledgement</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v1__">Boost.Assign
+ 1.0</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v2___">Boost.Assign
+ 2.0 </a></span></dt>
+</dl></dd>
+<dt><span class="section">Bibliography</span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="section" title="Help with qbk : without this enclosing section, the layout messes up!">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_assign_v2.dummy"></a><a class="link" href="index.html#boost_assign_v2.dummy" title="Help with qbk : without this enclosing section, the layout messes up!"> Help with qbk : without this enclosing
+ section, the layout messes up! </a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Preface</span></dt>
+<dt><span class="section"> User's guide</span></dt>
+<dd><dl>
+<dt><span class="section">Notation</span></dt>
+<dt><span class="section"> Working assumptions</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon"> Anonymous container
+ of references</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"> Assign copy</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.rebind"> Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.functor"> The functor
+ interface</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put"> Adaptors <code class="computeroutput"><span class="identifier">_csv_put</span></code> and <code class="computeroutput"><span class="identifier">_put</span></code>
+ </a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.usage"> Basic usage
+ </a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.std_modifier"> Standard
+ modifier</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding"> Argument
+ forwarding</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ptr_container"> Pointer
+ container</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ext_func"> Extended
+ functionality</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.test_knowledge"> Test
+ your knowledge</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.anon"> Anonymous container
+ of values</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _put_range</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _chain</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Conversion</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.conversion.anonymous_containers">Anonymous
+ containers</a></span></dt>
+<dt><span class="section">_chain adaptor</span></dt>
+<dt><span class="section">Inter-STL-categories</span></dt>
+</dl></dd>
+<dt><span class="section"> Configuring arity</span></dt>
+</dl></dd>
+<dt><span class="section">Reference</span></dt>
+<dt><span class="section">Runtime efficiency</span></dt>
+<dt><span class="section"> Testing platform</span></dt>
+<dt><span class="section">Portability</span></dt>
+<dt><span class="section">Dependencies</span></dt>
+<dt><span class="section">Change log</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__">[Proposal
+ for] Upgrading from Boost v<span class="emphasis"><em>1.4x</em></span>
+ to Boost.Assign 2.0</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization">The
+ new organization</a></span></dt>
+<dt><span class="section">Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface">The
+ new interface</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse">Code
+ reuse</a></span></dt>
+</dl></dd>
+</dl></dd>
+<dt><span class="section">Support</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement">History
+ and acknowledgement</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v1__">Boost.Assign
+ 1.0</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v2___">Boost.Assign
+ 2.0 </a></span></dt>
+</dl></dd>
+<dt><span class="section">Bibliography</span></dt>
+</dl></div>
+<div class="section" title="Preface">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.preface"></a><a class="link" href="index.html#boost_assign_v2.dummy.preface" title="Preface">Preface</a>
+</h3></div></div></div>
+<p>
+ The Boost.Assign 2.0 framework offers the following tools:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Putting elements in a container with an interface that is uniform across
+ container types.
+ </li>
+<li class="listitem">
+ Assignment between containers of different categories, such as from a
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>,
+ which models Sequence,
+ to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;&gt;</span></code>,
+ which is an <a href="http://www.sgi.com/tech/stl/Sequence.html" target="_top">adapter
+ container</a>
+</li>
+<li class="listitem">
+ An anonymous container (i.e. constructed in place) of values, whose interface
+ is akin to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;&gt;</span></code>.
+ </li>
+<li class="listitem">
+ An anonymous container (i.e. constructed in place) of references, whose
+ interface is akin to boost::array<>.
+ </li>
+<li class="listitem">
+ Forming the union of (chaining) ranges while preserving the properties
+ of the underlying iterator types, which is non-trivial if at least one
+ range is that of an anonymous container (a temporary) of lvalue references.
+ </li>
+</ul></div>
+<p>
+ These tools are for the most part available through adaptors, a concept borrowed
+ from adaptors
+ so that they work together nicely with <a href="http://www.boost.org/doc/libs/1_44_0/libs/range/doc/html/range/reference/algorithms.html" target="_top">range
+ algorithms</a>.
+ </p>
+</div>
+<div class="section" title="User's guide">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.ug"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug" title="User's guide"> User's guide</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Notation</span></dt>
+<dt><span class="section"> Working assumptions</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon"> Anonymous container
+ of references</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"> Assign copy</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.rebind"> Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.functor"> The functor
+ interface</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put"> Adaptors <code class="computeroutput"><span class="identifier">_csv_put</span></code> and <code class="computeroutput"><span class="identifier">_put</span></code>
+ </a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.usage"> Basic usage
+ </a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.std_modifier"> Standard
+ modifier</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding"> Argument
+ forwarding</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ptr_container"> Pointer
+ container</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ext_func"> Extended
+ functionality</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.test_knowledge"> Test
+ your knowledge</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.anon"> Anonymous container
+ of values</a></span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _put_range</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Adaptor _chain</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></dd>
+<dt><span class="section"> Conversion</span></dt>
+<dd><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.conversion.anonymous_containers">Anonymous
+ containers</a></span></dt>
+<dt><span class="section">_chain adaptor</span></dt>
+<dt><span class="section">Inter-STL-categories</span></dt>
+</dl></dd>
+<dt><span class="section"> Configuring arity</span></dt>
+</dl></div>
+<p>
+ This section describes the usage of the tools of this library. For specific
+ details, check the reference section.
+ </p>
+<p>
+ All the examples given therein are in the <code class="computeroutput"><span class="special">/</span><span class="identifier">libs</span><span class="special">/</span><span class="identifier">assign</span><span class="special">/</span><span class="identifier">v2</span><span class="special">/</span><span class="identifier">example</span><span class="special">/</span></code>
+ directory.
+ </p>
+<div class="section" title="Notation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.notation"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.notation" title="Notation">Notation</a>
+</h4></div></div></div>
+<div class="table">
+<a name="boost_assign_v2.dummy.ug.notation.symbols"></a><p class="title"><b>Table&#160;1.1.&#160;Symbols</b></p>
+<div class="table-contents"><table class="table" summary="Symbols">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Symbol
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">cont</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A container
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A key
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">t</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A data
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">u</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A key data pair
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">arg</code>
+ </p>
+ </td>
+<td>
+ <p>
+ An argument to a function
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">obj</code>
+ </p>
+ </td>
+<td>
+ <p>
+ An object defined in this library
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">p</code>
+ </p>
+ </td>
+<td>
+ <p>
+ A parameter for mutating an object
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ To represent the types of the above, we typically use the a capital letter.
+ For example <code class="computeroutput"><span class="identifier">T</span></code> is the type
+ of <code class="computeroutput"><span class="identifier">t</span></code>.
+ </p>
+<div class="table">
+<a name="boost_assign_v2.dummy.ug.notation.indexes"></a><p class="title"><b>Table&#160;1.2.&#160;Indexes</b></p>
+<div class="table-contents"><table class="table" summary="Indexes">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Expression
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">i</code> = 0, ..., <code class="literal">n</code>-1</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Indexes a sequences of <code class="computeroutput">t</code>'s
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">j</code> = 0, ..., <code class="literal">k</code>-1</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Indexes arguments associated with a <code class="computeroutput">t</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">k</code>[<code class="literal">i</code>] </code>
+ </p>
+ </td>
+<td>
+ <p>
+ Number of function arguments at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="computeroutput">arg</code>[<code class="literal">i</code>] </code>
+ </p>
+ </td>
+<td>
+ <p>
+ Set of arguments at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="computeroutput">arg</code>[<code class="literal">i</code>,<code class="literal">j</code>]</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">j</code> th argument at <code class="literal">i</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal">a</code>[<code class="literal">i</code>] , <code class="literal">b</code>[<code class="literal">i</code>]
+ , <code class="literal">c</code>[<code class="literal">i</code>] etc.
+ </p>
+ </td>
+<td>
+ <p>
+ Shorthand for <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">0</code>],
+ <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">1</code>],
+ <code class="literal">arg</code>[<code class="literal">i</code>,<code class="literal">2</code>]
+ etc.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="literal"> <code class="literal">l</code> = 0, ..., <code class="literal">m</code>-1</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Indexes a sequences of <code class="computeroutput">p</code>'s
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+<div class="section" title="Working assumptions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.wa"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.wa" title="Working assumptions"> Working assumptions</a>
+</h4></div></div></div>
+<p>
+ Here we give some pieces of code that will be assumed throughout. The chosen
+ set up is such that, by appealing to deduction, a broad range of needs,
+ including the basic ones, are adressed. What we mean by a basic need, is
+ filling a container with <code class="computeroutput"><span class="keyword">int</span></code>s.
+ What we mean by a need that is at the complexity boundary of our set up,
+ is working with a collection of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span></code>s
+ of references.
+ </p>
+<p>
+ The first piece of code are include statements:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">utility</span><span class="special">&gt;</span> <span class="comment">// std::pair
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assert</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">range</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assign</span><span class="special">/</span><span class="identifier">v2</span><span class="special">/</span><span class="identifier">v2</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Next, we define a <code class="computeroutput"><span class="keyword">struct</span></code>,
+ <code class="computeroutput"><span class="identifier">foo</span></code> :
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">foo</span>
+<span class="special">{</span>
+ <span class="identifier">foo</span><span class="special">():</span><span class="identifier">ptr_a</span><span class="special">(</span> <span class="number">0</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="number">0</span> <span class="special">){}</span>
+ <span class="identifier">foo</span><span class="special">(</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">ptr_a</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">a</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="number">0</span> <span class="special">){}</span>
+ <span class="identifier">foo</span><span class="special">(</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">b_</span><span class="special">):</span> <span class="identifier">ptr_a</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">a</span> <span class="special">),</span> <span class="identifier">b</span><span class="special">(</span> <span class="identifier">b_</span> <span class="special">){}</span>
+
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">other</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">ptr_a</span> <span class="special">==</span> <span class="identifier">other</span><span class="special">.</span><span class="identifier">ptr_a</span><span class="special">)</span> <span class="special">&amp;&amp;</span> <span class="special">(</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">b</span> <span class="special">==</span> <span class="identifier">other</span><span class="special">.</span><span class="identifier">b</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">foo</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">delta</span><span class="special">){</span> <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">b</span> <span class="special">+=</span> <span class="identifier">delta</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">(*</span><span class="keyword">this</span><span class="special">);</span> <span class="special">}</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">friend</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">foo</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">);</span>
+ <span class="keyword">int</span><span class="special">*</span> <span class="identifier">ptr_a</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">b</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="keyword">struct</span> <span class="identifier">make_foo</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">foo</span> <span class="identifier">result_type</span><span class="special">;</span>
+ <span class="identifier">result_type</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">result_type</span><span class="special">(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&lt;&lt;(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+
+<span class="keyword">struct</span> <span class="identifier">printer</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">void</span> <span class="identifier">result_type</span><span class="special">;</span>
+
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os_</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">os</span><span class="special">(</span> <span class="identifier">os_</span> <span class="special">){}</span>
+
+ <span class="identifier">result_type</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">foo</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span><span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">os</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">mutable</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">os</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ The exact definition of <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></code> can be found in the file foo.cpp
+ .
+ </p>
+<p>
+ Then come some dependent types,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">S</span><span class="special">;</span> <span class="comment">// key
+</span><span class="keyword">typedef</span> <span class="identifier">foo</span> <span class="identifier">T</span><span class="special">;</span> <span class="comment">// data
+</span><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">U</span><span class="special">;</span> <span class="comment">//key-data pair
+</span></pre>
+<p>
+ </p>
+<p>
+ and finally a set of constants :
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span><span class="special">{</span>
+
+<span class="keyword">int</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">=</span> <span class="number">5</span><span class="special">;</span>
+
+<span class="identifier">S</span> <span class="identifier">key_x</span> <span class="special">=</span> <span class="string">"x"</span> <span class="special">;</span>
+<span class="identifier">S</span> <span class="identifier">key_y</span> <span class="special">=</span> <span class="string">"y"</span> <span class="special">;</span>
+<span class="identifier">S</span> <span class="identifier">key_z</span> <span class="special">=</span> <span class="string">"z"</span> <span class="special">;</span>
+
+<span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">x</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">);</span> <span class="comment">// (1, 0)
+</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">y</span><span class="special">;</span> <span class="comment">// (NULL, 0)
+</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">z</span><span class="special">(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">);</span> <span class="comment">//(1, 5)
+</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ In terms of our notation, by seeing <code class="computeroutput">x</code>, <code class="computeroutput">y</code>, and
+ <code class="computeroutput">z</code> as forming a sequence, <code class="computeroutput">n <span class="special">=</span>
+ <span class="number">3</span></code>, <code class="computeroutput">k<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">1</span></code>, <code class="computeroutput">k<span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">0</span></code>, and <code class="computeroutput">k<span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span>
+ <span class="number">2</span></code>.
+ </p>
+</div>
+<div class="section" title="Anonymous container of references">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.ref_anon"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon" title="Anonymous container of references"> Anonymous container
+ of references</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"> Assign copy</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.rebind"> Assign
+ rebind</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.ref_anon.functor"> The functor
+ interface</a></span></dt>
+</dl></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.ref_anon.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span>
+ _nil <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">&lt;</span><span class="number">0</span><span class="special">,</span> <span class="identifier">U</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span>
+ t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span>
+ t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span>
+ <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">&lt;</span>n<span class="special">,</span>
+ <span class="identifier">U</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span>
+ _nil <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="number">0</span><span class="special">,</span> <span class="identifier">U</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">anon</span><span class="special">(</span>
+ t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span>
+ t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span>
+ <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span>n<span class="special">,</span><span class="identifier">U</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<p>
+ where <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_xxx</span></code> is either of <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span></code> or <code class="computeroutput"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_rebind</span></code>,
+ and <code class="computeroutput"><span class="identifier">U</span></code> is <code class="computeroutput"><span class="identifier">T</span> <span class="keyword">const</span></code>
+ if <code class="computeroutput">t<span class="special">[</span>i<span class="special">]</span></code>
+ is <code class="computeroutput"><span class="keyword">const</span></code> or an <code class="computeroutput"><span class="identifier">rvalue</span></code>, for at least one <code class="computeroutput">i</code>,
+ and <code class="computeroutput"><span class="identifier">U</span></code> is <code class="computeroutput"><span class="identifier">T</span></code> otherwise.
+ </p>
+<div class="section" title="Assign copy">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.ref_anon.copy"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon.copy" title="Assign copy"> Assign copy</a>
+</h5></div></div></div>
+<p>
+ To work with references, the relevant <code class="computeroutput"><span class="keyword">namespace</span></code>
+ is <code class="computeroutput"><span class="identifier">ref</span></code>, but we also need
+ a nested <code class="computeroutput"><span class="keyword">namespace</span></code> that
+ specifies an assignment policy. For example,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">),</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+<span class="comment">//outputs (1,0)(NULL,0)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The result from <code class="computeroutput"><span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">()</span></code>
+ is more than just a range. It has much of the functionality of the static
+ array, boost::array<>,
+ such as <code class="computeroutput"><span class="identifier">assign</span><span class="special">()</span></code>,
+ as we now illustrate,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">x1</span><span class="special">,</span> <span class="identifier">y1</span><span class="special">,</span> <span class="identifier">z1</span><span class="special">;</span>
+<span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x1</span><span class="special">,</span> <span class="identifier">y1</span><span class="special">,</span> <span class="identifier">z1</span> <span class="special">).</span><span class="identifier">assign</span><span class="special">(</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">)</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">y1</span> <span class="special">==</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="Assign rebind">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.ref_anon.rebind"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon.rebind" title="Assign rebind"> Assign
+ rebind</a>
+</h5></div></div></div>
+<p>
+ We now turn to the rebind assignment policy. Here, it will be necessary
+ to save the result:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_rebind</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result_</span><span class="special">;</span>
+<span class="identifier">result_</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">result</span><span class="special">[</span> <span class="number">1</span> <span class="special">]</span> <span class="special">==</span> <span class="special">&amp;</span><span class="identifier">y</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Thus far, the side effect would be the same under the <code class="computeroutput"><span class="identifier">assign_copy</span></code>
+ policy. The effect of assigning a new object to each element of our result,
+ however, is different:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">w</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">);</span> <span class="identifier">result</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span> <span class="identifier">w</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">result</span><span class="special">[</span> <span class="number">1</span> <span class="special">]</span> <span class="special">==</span> <span class="special">&amp;</span><span class="identifier">w</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="The functor interface">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.ref_anon.functor"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon.functor" title="The functor interface"> The functor
+ interface</a>
+</h5></div></div></div>
+<p>
+ The functor interface works as follows:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_rebind</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="number">2</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result1_</span><span class="special">;</span>
+<span class="identifier">result1_</span> <span class="identifier">result1</span> <span class="special">=</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">anon</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">)(</span> <span class="identifier">y</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ and <code class="computeroutput"><span class="identifier">result1</span></code> has all the
+ functionality of that resulting from <code class="computeroutput"><span class="identifier">csv_anon</span><span class="special">(</span>x<span class="special">,</span> y<span class="special">)</span></code>. Unlike the latter, it's possible to
+ append an element:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">nth_result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">result2_</span><span class="special">;</span>
+<span class="identifier">result2_</span> <span class="identifier">result2</span> <span class="special">=</span> <span class="identifier">result1</span><span class="special">(</span> <span class="identifier">z</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Internally, <code class="computeroutput"><span class="identifier">result2</span></code> keeps
+ a reference to <code class="computeroutput"><span class="identifier">result1</span></code>,
+ and not until the boost::array<>
+ interface is called, as in
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">result2</span><span class="special">,</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ is a static array allocated, with reference wrappers, in this case, for
+ <code class="computeroutput">x</code>, <code class="computeroutput">y</code> and <code class="computeroutput">z</code>,
+ </p>
+</div>
+</div>
+<div class="section" title="Adaptors _csv_put and _put">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.put"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put" title="Adaptors _csv_put and _put"> Adaptors <code class="computeroutput"><span class="identifier">_csv_put</span></code> and <code class="computeroutput"><span class="identifier">_put</span></code>
+ </a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.usage"> Basic usage
+ </a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.std_modifier"> Standard
+ modifier</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding"> Argument
+ forwarding</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ptr_container"> Pointer
+ container</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.ext_func"> Extended
+ functionality</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.put.test_knowledge"> Test
+ your knowledge</a></span></dt>
+</dl></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div>
+<div class="table">
+<a name="boost_assign_v2.dummy.ug.put.synopsis.the_put_adaptor"></a><p class="title"><b>Table&#160;1.3.&#160;The put adaptor</b></p>
+<div class="table-contents"><table class="table" summary="The put adaptor">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">cont <span class="special">|</span> <span class="special">(</span><span class="identifier">adaptor</span><span class="special">::</span><span class="identifier">_csv_put</span> <span class="special">%</span>
+ p<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">%</span>
+ <span class="special">...</span> <span class="special">%</span>
+ p<span class="special">[</span>m<span class="special">]</span>
+ <span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span>
+ <span class="special">....,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">Cont<span class="special">&amp;</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">cont <span class="special">|</span> <span class="special">(</span><span class="identifier">adaptor</span><span class="special">::</span><span class="identifier">_put</span> <span class="special">%</span>
+ p<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">%</span>
+ <span class="special">...</span> <span class="special">%</span>
+ p<span class="special">[</span>m<span class="special">]</span>
+ <span class="special">)(</span> arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span>
+ arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span>k<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]])</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">Cont<span class="special">&amp;</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+<div class="section" title="Basic usage">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.usage"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.usage" title="Basic usage"> Basic usage
+ </a>
+</h5></div></div></div>
+<p>
+ To put elements, <code class="computeroutput">x</code>, <code class="computeroutput">y</code> and <code class="computeroutput">z</code> into
+ a container,
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_csv_put</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">),</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+<span class="comment">//outputs (1,0)(NULL,0)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The workings and benefits of adaptors are developed in <a href="http://www.boost.org/doc/libs/1_44_0/libs/range/doc/html/range/reference/adaptors.html" target="_top">range
+ adaptors</a>, so they will not be repeated here. For our purpose,
+ however, keep in mind that our adaptor modifies the state of a container
+ before returning it. Specifically, the statement inside the first argument
+ of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span></code> is equivalent, for this particular
+ container type, to
+</p>
+<pre class="programlisting">cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> x <span class="special">);</span>
+cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> y <span class="special">);</span>
+cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> z <span class="special">);</span>
+</pre>
+<p>
+ and returns a reference to <code class="computeroutput"><span class="identifier">cont</span></code>.
+ The result from <code class="computeroutput"><span class="identifier">_csv_put</span><span class="special">(</span> x<span class="special">,</span> y <span class="special">,</span>z <span class="special">)</span></code> internally
+ keeps references to <code class="computeroutput">x</code>, <code class="computeroutput">y</code> , <code class="computeroutput">z</code>,
+ so as to avoid any storage overhead.
+ </p>
+</div>
+<div class="section" title="Standard modifier">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.std_modifier"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier" title="Standard modifier"> Standard
+ modifier</a>
+</h5></div></div></div>
+<p>
+ A container has one or more member functions to alter its state, and
+ in the case that interests us, adding elements. For example, <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ is what we call, in this library, a standard modifier.
+ </p>
+<div class="section" title="Automatic deduction">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.std_modifier.auto"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier.auto" title="Automatic deduction">
+ Automatic deduction</a>
+</h6></div></div></div>
+<p>
+ We have just encountered one instance of a <a href="http://www.sgi.com/tech/stl/Sequence.html" target="_top">sequence
+ container</a>, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>. In fact, the same adaptor
+ works seamlessly with the other categories of STL
+ containers, associative,
+ and adapter
+ (<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;&gt;</span></code>
+ and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">queue</span><span class="special">&lt;&gt;</span></code>),
+ and the static array boost::array<>.
+ For example,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">cont_</span><span class="special">::</span><span class="identifier">value_type</span> <span class="identifier">key_data_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span>
+ <span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_csv_put</span><span class="special">(</span>
+ <span class="identifier">key_data_</span><span class="special">(</span><span class="identifier">key_z</span><span class="special">,</span> <span class="identifier">z</span><span class="special">),</span>
+ <span class="identifier">key_data_</span><span class="special">(</span><span class="identifier">key_y</span><span class="special">,</span> <span class="identifier">y</span><span class="special">),</span>
+ <span class="identifier">key_data_</span><span class="special">(</span><span class="identifier">key_x</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)[</span><span class="identifier">key_x</span><span class="special">]</span> <span class="special">==</span> <span class="identifier">x</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ In this instance, instead of <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>, as we had explained in the case
+ of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>,
+ <code class="computeroutput"><span class="identifier">insert</span><span class="special">()</span></code>
+ is the modifier that is called. This choice is made at compile time
+ by the library, based on certain properties of the destination container
+ (traits).
+ </p>
+<p>
+ The repetition of <code class="computeroutput"><span class="identifier">key_data_</span><span class="special">()</span></code> in the code, though, is not very
+ elegant. There is a better solution, but it would be outside of the
+ topic of this section and therefore it will be shown in a subsequent
+ one.
+ </p>
+</div>
+<div class="section" title="User specified">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.std_modifier.user"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier.user" title="User specified">
+ User specified</a>
+</h6></div></div></div>
+<p>
+ We have seen that the library automatically chooses a modifier at compile
+ time, such as <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">insert</span><span class="special">()</span></code> in the cases of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>, and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;&gt;</span></code>, respectively. We can, however,
+ choose the modifier explicitly. This makes sense, for example, for
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;&gt;</span></code>
+ because the default modifier is <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>, whereas the user may in fact wish
+ to call <code class="computeroutput"><span class="identifier">push_front</span><span class="special">()</span></code>,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="special">(</span><span class="identifier">_csv_put</span> <span class="special">%</span> <span class="identifier">_push_front</span><span class="special">)(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+<span class="comment">//outputs (1,5)(NULL,0)(1,0)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Here's a catalog of the different standard modifiers.
+ </p>
+<div class="table">
+<a name="boost_assign_v2.dummy.ug.put.std_modifier.user.standard_modifier"></a><p class="title"><b>Table&#160;1.4.&#160;Standard modifier</b></p>
+<div class="table-contents"><table class="table" summary="Standard modifier">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Parameter
+ </p>
+ </th>
+<th>
+ <p>
+ Implementation
+ </p>
+ </th>
+<th>
+ <p>
+ Default
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">_push_back</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> t <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Sequence
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">_push_front</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">cont<span class="special">.</span><span class="identifier">push_front</span><span class="special">(</span> t <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">_push</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">cont<span class="special">.</span><span class="identifier">push</span><span class="special">(</span> t <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Adapters
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">_at_next</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">cont<span class="special">[</span> i<span class="special">++</span>
+ <span class="special">]</span> <span class="special">=</span>
+ t </code>
+ </p>
+ </td>
+<td>
+ <p>
+ <a href="http://www.boost.org/doc/libs/release/doc/html/array.html" target="_top">Static
+ arrays</a>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">_insert</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">cont<span class="special">.</span><span class="identifier">insert</span><span class="special">(</span> t <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Associative
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ where index <code class="computeroutput">i</code> is initialized to zero.
+ </p>
+<p>
+ More generally, <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>, in conjunction with the adaptor generator
+ <code class="computeroutput"><span class="identifier">_csv_put</span></code> is used to
+ pass a parameter to the latter (not just a modifier) that determines
+ the implementation of <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>. Just as the latter, <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>
+ is composable. Make sure to keep any statement involving <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>
+ and <code class="computeroutput"><span class="identifier">_csv_put</span></code> in between
+ brackets, as shown above.
+ </p>
+</div>
+<div class="section" title="Custom">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.std_modifier.custom_"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier.custom_" title="Custom">Custom
+ </a>
+</h6></div></div></div>
+<p>
+ Imagine that the user has defined his/her own container, and that
+ <code class="computeroutput"><span class="identifier">baz</span><span class="special">()</span></code>
+ is the member function by which elements are inserted:
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">bar</span><span class="special">{</span> <span class="keyword">void</span> <span class="identifier">baz</span><span class="special">();</span> <span class="special">};</span>
+</pre>
+<p>
+ By first expanding
+</p>
+<pre class="programlisting"><span class="identifier">BOOST_ASSIGN_V2_PUT_MODIFIER_XXX</span><span class="special">(</span><span class="identifier">baz</span><span class="special">)</span>
+</pre>
+<p>
+ it's then possible to call, say
+</p>
+<pre class="programlisting"><span class="identifier">bar</span> cont<span class="special">;</span>
+cont <span class="special">|</span> <span class="special">(</span><span class="identifier">_csv_put</span> <span class="special">%</span> <span class="identifier">_baz</span><span class="special">)(</span> x<span class="special">,</span> y<span class="special">,</span> z <span class="special">);</span>
+</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" title="Argument forwarding">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.arg_forwarding"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding" title="Argument forwarding"> Argument
+ forwarding</a>
+</h5></div></div></div>
+<div class="section" title="Automatic deduction">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.arg_forwarding.auto"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding.auto" title="Automatic deduction">
+ Automatic deduction</a>
+</h6></div></div></div>
+<p>
+ The adaptor generator <code class="computeroutput"><span class="identifier">_csv_put</span></code>
+ which we have discussed so far is fine when the objects to be put into
+ a container are already constructed. Otherwise, we have to construct
+ them in place, e.g.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_csv_put</span><span class="special">(</span> <span class="identifier">foo</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">),</span> <span class="identifier">foo</span><span class="special">(),</span> <span class="identifier">foo</span><span class="special">(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">)</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ We can achieve the same result, but with code that is more compact,
+ using a functor analog to <code class="computeroutput"><span class="identifier">_csv_put</span></code>,
+ <code class="computeroutput"><span class="identifier">_put</span></code>, that takes care
+ of forwarding to the constructor:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_put</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">)()(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ The appropriate constructor is deduced at compile time, from the value
+ type of the destination container.
+ </p>
+<p>
+ We are now able to show how to overcome the drawback that was pointed
+ out when filling a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;&gt;</span></code>, i.e. that the constructor
+ had to be called explicitly for each pair key-data arguments. Continuing
+ that <a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier.auto" title="Automatic deduction">example</a>,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">cont</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span>
+ <span class="special">(</span> <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_put</span> <span class="special">(</span><span class="identifier">key_z</span><span class="special">,</span> <span class="identifier">z</span><span class="special">)(</span><span class="identifier">key_y</span><span class="special">,</span> <span class="identifier">y</span><span class="special">)(</span><span class="identifier">key_x</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">)[</span><span class="identifier">key_x</span><span class="special">]</span> <span class="special">==</span> <span class="identifier">x</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<div class="warning" title="Warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../doc/html/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Using the adaptor <code class="computeroutput"><span class="identifier">_put</span></code>
+ may have greater compilation needs than <code class="computeroutput"><span class="identifier">_csv_put</span></code>.
+ For large <code class="literal">n</code> and <code class="literal">k</code>, it may be
+ necessary to construct objects in place, and pass them to <code class="computeroutput"><span class="identifier">_csv_put</span></code>. As an indication, under
+ the <a class="link" href="index.html#boost_assign_v2.dummy.testing_platform" title="Testing platform">default
+ testing platform</a>, <code class="literal">n &gt; 32</code> and <code class="literal">k
+ = 1</code>, <code class="computeroutput"><span class="identifier">_put</span></code>
+ becomes problematic.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" title="User specified">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.arg_forwarding.user"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding.user" title="User specified">
+ User specified</a>
+</h6></div></div></div>
+<p>
+ As we have just seen, forwarding to the constructor is the default
+ choice. We can override it with <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code> in conjuction with <code class="computeroutput"><span class="identifier">_fun</span></code>.
+ Continuing from the previous example involving <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">a0</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="identifier">a1</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">a2</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span>
+<span class="identifier">cont</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="special">(</span>
+ <span class="identifier">_put</span> <span class="special">%</span> <span class="special">(</span> <span class="identifier">_fun</span> <span class="special">=</span> <span class="identifier">make_foo</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)(</span> <span class="identifier">a0</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">)(</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">)(</span> <span class="identifier">a2</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+<span class="comment">//outputs (-1,5)(0,5)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Users that are familiar with the lambda
+ library will have recognized that the repetition of <code class="computeroutput"><span class="identifier">b</span></code>
+ would be better avoided thanks to a binding functor:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">cont</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lambda</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="special">(</span>
+ <span class="identifier">_csv_put</span> <span class="special">%</span> <span class="special">(</span><span class="identifier">_fun</span> <span class="special">=</span> <span class="identifier">bind</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span> <span class="identifier">make_foo</span><span class="special">(),</span> <span class="identifier">_1</span><span class="special">,</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)(</span><span class="identifier">a0</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Notice that since each argument in the sequence is now unary, we were
+ able to revert to using <code class="computeroutput"><span class="identifier">_csv_put</span></code>,
+ and did so only because it's more elegant that way.
+ </p>
+</div>
+</div>
+<div class="section" title="Pointer container">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.ptr_container"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.ptr_container" title="Pointer container"> Pointer
+ container</a>
+</h5></div></div></div>
+<p>
+ The same functionality as that for STL containers works for <a href="http://www.boost.org/doc/libs/release/libs/ptr_container/doc/ptr_container.html" target="_top">pointer
+ containers</a>, but the side effect is a bit different. For example,
+ consider,
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptr_vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span> <span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="identifier">_csv_put</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Copies of <code class="computeroutput">x</code>, <code class="computeroutput">y</code> and <code class="computeroutput">z</code> are allocated
+ on the heap, and their pointers put into <code class="computeroutput"><span class="identifier">cont</span></code>,
+ using <code class="computeroutput"><span class="identifier">push_back</span></code>, in this
+ case. Just as with other categories of containers, we can override both
+ the modifier and the argument forwarding mechanism, by passign the appropriate
+ parameters with <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>.
+ </p>
+</div>
+<div class="section" title="Extended functionality">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.ext_func"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.ext_func" title="Extended functionality"> Extended
+ functionality</a>
+</h5></div></div></div>
+<p>
+ We have seen that there are two orthogonal parametrization: the standard
+ modifier, e.g. <code class="computeroutput"><span class="identifier">_push_back</span></code>
+ and the forwarding functor, e.g. <code class="computeroutput"><span class="identifier">_fun</span>
+ <span class="special">=</span> <span class="identifier">make_foo</span><span class="special">()</span></code>. Here, we discuss parametrization that
+ is more complex.
+ </p>
+<div class="section" title="Repeating an argument">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_assign_v2.dummy.ug.put.ext_func.repeat"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.ext_func.repeat" title="Repeating an argument">
+ Repeating an argument</a>
+</h6></div></div></div>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">cont</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="special">(</span> <span class="identifier">_csv_put</span> <span class="special">%</span> <span class="special">(</span> <span class="identifier">_repeat</span> <span class="special">=</span> <span class="number">2</span> <span class="special">)</span> <span class="special">)(</span> <span class="identifier">x</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+<span class="comment">// outputs (1,0)(1,0)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" title="Test your knowledge">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put.test_knowledge"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put.test_knowledge" title="Test your knowledge"> Test
+ your knowledge</a>
+</h5></div></div></div>
+<p>
+ Look at the piece of code below, and try to figure out what the output
+ will be. Notice that shown in the comments are the outputs of the individual
+ values, in the order in which they are passed to the adaptor generator.
+ For example, the output of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> x</code> is <code class="literal">(1,0)</code>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+<span class="identifier">cont_</span> <span class="identifier">cont</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lambda</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont</span> <span class="special">|</span> <span class="special">(</span> <span class="identifier">_csv_put</span> <span class="special">)(</span> <span class="identifier">x</span> <span class="special">)</span> <span class="comment">/*(1,0)*/</span> <span class="special">|</span> <span class="special">(</span>
+ <span class="identifier">_put</span> <span class="special">%</span> <span class="identifier">_push_front</span> <span class="special">%</span> <span class="special">(</span> <span class="identifier">_repeat</span> <span class="special">=</span> <span class="number">2</span> <span class="special">)</span>
+ <span class="special">)()(</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">a</span> <span class="special">)</span> <span class="comment">/*(NULL,0)(5,1)*/</span> <span class="special">|</span> <span class="special">(</span>
+ <span class="identifier">_csv_put</span> <span class="special">%</span> <span class="special">(</span> <span class="identifier">_fun</span> <span class="special">=</span> <span class="identifier">bind</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span> <span class="identifier">make_foo</span><span class="special">(),</span> <span class="identifier">_1</span><span class="special">,</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)(</span> <span class="identifier">a0</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span> <span class="special">),</span> <span class="comment">/*(-1,5)(0,5)(1,5)*/</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The right answer is:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// outputs (5,1)(5,1)(NULL,0)(NULL,0)(1,0)(-1,5)(0,5)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" title="Anonymous container of values">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.anon"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.anon" title="Anonymous container of values"> Anonymous container
+ of values</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.anon.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.anon.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">csv_anon</span><span class="special">(</span>
+ t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span>
+ <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span> <span class="identifier">anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span><span class="identifier">_nil</span><span class="special">)</span> <span class="special">%</span>
+ p<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">%</span>
+ <span class="special">...</span> <span class="special">%</span>
+ p<span class="special">[</span>m<span class="special">]</span>
+ <span class="special">)(</span> arg<span class="special">[</span><span class="number">0</span><span class="special">][</span><span class="number">0</span><span class="special">],</span>
+ <span class="special">...,</span> arg<span class="special">[</span><span class="number">0</span><span class="special">][</span>k<span class="special">[</span><span class="number">0</span><span class="special">]])...(</span> arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span>
+ arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span>k<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]])</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" title="Usage">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.anon.usage"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.anon.usage" title="Usage">Usage</a>
+</h5></div></div></div>
+<p>
+ An anonymous container of values is akin to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;&gt;</span></code> that can be constructed in place.
+ </p>
+<p>
+ Here's an example using the csv form:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">csv_anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span> <span class="special">,</span><span class="identifier">z</span> <span class="special">),</span> <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span> <span class="special">);</span>
+<span class="comment">// outputs (1,0)(NULL,0)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ Here's an example using the functor form, and a parameter passed with
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="special">(</span><span class="identifier">anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span> <span class="identifier">_nil</span> <span class="special">)</span> <span class="special">%</span> <span class="identifier">_push_front</span><span class="special">)(</span> <span class="identifier">a</span> <span class="special">)()(</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">)</span>
+<span class="special">);</span>
+<span class="comment">// outputs (1,5)(NULL,0)(1,0)
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The section is kept brief, because one can deduce the workings of the
+ interface from that of the <a class="link" href="index.html#boost_assign_v2.dummy.ug.put" title="Adaptors _csv_put and _put"><code class="computeroutput"><span class="identifier">_put</span></code> adaptor</a>, which is explained
+ in detail. Specifically, the <code class="computeroutput"><span class="identifier">csv</span></code>
+ vs argument forwarding (functor) dichotomy and the parameter passing
+ mechanism, via <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>, are the same.
+ </p>
+</div>
+</div>
+<div class="section" title="Adaptor _put_range">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.put_range"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put_range" title="Adaptor _put_range"> Adaptor <code class="computeroutput"><span class="identifier">_put_range</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put_range.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put_range.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput">to <span class="special">|</span> <span class="identifier">adaptor</span><span class="special">::</span><span class="identifier">_put_range</span><span class="special">(</span> from <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">To<span class="special">&amp;</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section" title="Usage">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.put_range.usage"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.put_range.usage" title="Usage">Usage</a>
+</h5></div></div></div>
+<p>
+ In this example we show how to put a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code>'s element into a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">queue</span><span class="special">&lt;&gt;</span></code>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">from_</span><span class="special">;</span> <span class="identifier">from_</span> <span class="identifier">from</span><span class="special">(</span> <span class="number">3</span> <span class="special">);</span>
+<span class="identifier">from</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">queue</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">to_</span><span class="special">;</span> <span class="identifier">to_</span> <span class="identifier">to</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">to</span> <span class="special">|</span> <span class="identifier">_put_range</span><span class="special">(</span> <span class="identifier">from</span> <span class="special">)</span> <span class="special">).</span><span class="identifier">front</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">x</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">to</span><span class="special">.</span><span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">z</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<div class="note" title="Note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Reversing the roles <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;</span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">queue</span><span class="special">&lt;&gt;</span></code> in the above operation will
+ not compile, because the input container, <code class="computeroutput"><span class="identifier">from</span></code>,
+ must model a <a href="http://www.boost.org/doc/libs/1_43_0/libs/range/doc/html/range/concepts.html" target="_top">forward
+ range</a>.
+ </p></td></tr>
+</table></div>
+</div>
+</div>
+<div class="section" title="Adaptor _chain">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.chain"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.chain" title="Adaptor _chain"> Adaptor <code class="computeroutput"><span class="identifier">_chain</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Usage</span></dt>
+</dl></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput">r1 <span class="special">|</span> <span class="identifier">adaptor</span><span class="special">::</span><span class="identifier">_chain</span><span class="special">(</span> r2 <span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">chain</span><span class="special">&lt;</span>R1<span class="special">,</span>R2<span class="special">&gt;::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<div class="section" title="Synopsis"><div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.chain.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.chain.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div></div>
+<div class="section" title="Usage">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.chain.usage"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.chain.usage" title="Usage">Usage</a>
+</h5></div></div></div>
+<p>
+ Adaptor <code class="computeroutput"><span class="identifier">_chain</span></code> is an
+ outgrowth of a similar functionality that appeared in the beta version
+ of Boost.RangeEx
+ that maps two ranges into their union. It is composable, as illustrated
+ below:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">1</span><span class="special">&gt;</span> <span class="identifier">cont1_</span><span class="special">;</span> <span class="identifier">cont1_</span> <span class="identifier">cont1</span><span class="special">;</span> <span class="identifier">cont1</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">cont3_</span><span class="special">;</span> <span class="identifier">cont3_</span> <span class="identifier">cont3</span><span class="special">;</span> <span class="identifier">cont3</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> <span class="identifier">z</span> <span class="special">);</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
+ <span class="identifier">cont1</span> <span class="special">|</span> <span class="identifier">_chain</span><span class="special">(</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">y</span> <span class="special">)</span> <span class="special">)</span> <span class="special">|</span> <span class="identifier">_chain</span><span class="special">(</span> <span class="identifier">cont3</span> <span class="special">),</span>
+ <span class="identifier">printer</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">)</span>
+<span class="special">);</span>
+<span class="comment">// outputs (1,0)(NULL,0)(1,5)
+</span></pre>
+<p>
+ </p>
+<p>
+ Adaptor <code class="computeroutput"><span class="identifier">_chain</span></code> has the
+ special property that it is lvalue preserving. Let us explain. An anonymous
+ container of references, by definition (anonymous means constructed in
+ place), is an rvalue. The references themselves, however, may be lvalue.
+ Two chained ranges, either of which is passed as an rvalue, but both
+ of which hold lvalues, is a range whose references are lvalues. Let us
+ now illustrate this:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">y1</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vec_</span><span class="special">;</span> <span class="identifier">vec_</span> <span class="identifier">vec</span><span class="special">(</span> <span class="number">3</span><span class="special">,</span> <span class="identifier">y</span> <span class="special">);</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span>
+ <span class="identifier">vec</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">begin</span><span class="special">(</span>
+ <span class="identifier">cont1</span> <span class="comment">/* lvalue */</span> <span class="special">|</span> <span class="identifier">_chain</span><span class="special">(</span>
+ <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">y1</span> <span class="comment">/* lvalue */</span> <span class="special">)</span> <span class="comment">/* rvalue */</span>
+ <span class="special">)</span> <span class="special">|</span> <span class="identifier">_chain</span><span class="special">(</span> <span class="identifier">cont3</span> <span class="comment">/* lvalue */</span> <span class="special">)</span>
+ <span class="special">)</span>
+<span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">cont1</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">y1</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">);</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">cont3</span><span class="special">.</span><span class="identifier">front</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">y1</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<p>
+ Also see the section on conversion.
+ </p>
+</div>
+<div class="section" title="Conversion">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.conversion"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion" title="Conversion"> Conversion</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.ug.conversion.anonymous_containers">Anonymous
+ containers</a></span></dt>
+<dt><span class="section">_chain adaptor</span></dt>
+<dt><span class="section">Inter-STL-categories</span></dt>
+</dl></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.conversion.synopsis"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion.synopsis" title="Synopsis">Synopsis</a>
+</h5></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">from</span> <span class="special">|</span>
+ <span class="identifier">convert</span><span class="special">&lt;</span>To<span class="special">&gt;()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">To</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">obj<span class="special">.</span><span class="identifier">convert</span><span class="special">&lt;</span>To<span class="special">&gt;()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">To</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput">to <span class="special">=</span> obj</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput">To<span class="special">&amp;</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ where <code class="computeroutput">obj</code> is either an anonymous container, of values or
+ references, or the result from the <code class="computeroutput"><span class="identifier">_chain</span></code>
+ adaptor.
+ </p>
+</div>
+<div class="section" title="Anonymous containers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.conversion.anonymous_containers"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion.anonymous_containers" title="Anonymous containers">Anonymous
+ containers</a>
+</h5></div></div></div>
+<p>
+ Anonymous containers can be converted to an arbitray containers. Such
+ as tool is particularly relevant when the destination container is an
+ <a href="http://en.wikipedia.org/wiki/Standard_Template_Library" target="_top">adapter
+ container</a> as they cannot be constructed from a pair of iterators.
+ </p>
+<p>
+ It's possible to perform conversion in place, as is sometimes necessary
+ for copy-constructing a container:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">queue</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">to_</span><span class="special">;</span>
+<span class="identifier">to_</span> <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">).</span><span class="identifier">convert</span><span class="special">&lt;</span><span class="identifier">to_</span><span class="special">&gt;();</span>
+<span class="identifier">to</span><span class="special">.</span><span class="identifier">pop</span><span class="special">();</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">to</span><span class="special">.</span><span class="identifier">front</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">);</span> <span class="comment">// because FIFO
+</span></pre>
+<p>
+ </p>
+<p>
+ While we can use the same member function, <code class="computeroutput"><span class="identifier">convert</span><span class="special">&lt;&gt;()</span></code>, to assign a container, implicit
+ conversion suffices:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">to_</span><span class="special">;</span>
+<span class="identifier">to_</span> <span class="identifier">to</span><span class="special">;</span> <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">z</span> <span class="special">);</span>
+<span class="identifier">to</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span> <span class="identifier">BOOST_ASSERT</span><span class="special">(</span> <span class="identifier">to</span><span class="special">.</span><span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="_chain adaptor">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.conversion.__chain__adaptor"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion.__chain__adaptor" title="_chain adaptor"><code class="computeroutput"><span class="identifier">_chain</span></code> adaptor</a>
+</h5></div></div></div>
+<p>
+ Here's a case where chaining takes places:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">2</span><span class="special">&gt;</span> <span class="identifier">from_</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">to_</span><span class="special">;</span>
+<span class="identifier">from_</span> <span class="identifier">from</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">;</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span>
+ <span class="special">(</span>
+ <span class="special">(</span>
+ <span class="identifier">from</span> <span class="special">|</span> <span class="identifier">_chain</span><span class="special">(</span> <span class="identifier">ns</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> <span class="identifier">z</span> <span class="special">)</span> <span class="special">)</span>
+ <span class="special">).</span><span class="identifier">convert</span><span class="special">&lt;</span><span class="identifier">to_</span><span class="special">&gt;()</span>
+ <span class="special">).</span><span class="identifier">top</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">z</span> <span class="comment">// because LIFO
+</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" title="Inter-STL-categories">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.ug.conversion.inter_stl_categories"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion.inter_stl_categories" title="Inter-STL-categories">Inter-STL-categories</a>
+</h5></div></div></div>
+<p>
+ The library also caters to inter STL categories conversion, with the
+ help of the <code class="computeroutput"><span class="identifier">_convert</span></code>
+ adaptor. Here's an example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">3</span><span class="special">&gt;</span> <span class="identifier">from_</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">to_</span><span class="special">;</span>
+<span class="identifier">from_</span> <span class="identifier">from</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">from</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">adaptor</span><span class="special">;</span>
+<span class="identifier">BOOST_ASSERT</span><span class="special">(</span>
+ <span class="special">(</span> <span class="identifier">from</span> <span class="special">|</span> <span class="identifier">convert</span><span class="special">&lt;</span><span class="identifier">to_</span><span class="special">&gt;()</span> <span class="special">).</span><span class="identifier">top</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">z</span> <span class="comment">// because LIFO
+</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" title="Configuring arity">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.ug.arity"></a><a class="link" href="index.html#boost_assign_v2.dummy.ug.arity" title="Configuring arity"> Configuring arity</a>
+</h4></div></div></div>
+<p>
+ Below are overridable constants. In the first column is the constant's
+ identifier, it's default value, and the relevant <a class="link" href="index.html#boost_assign_v2.dummy.ug.notation" title="Notation">index</a>
+ that they control.
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Constant
+ </p>
+ </th>
+<th>
+ <p>
+ Default value
+ </p>
+ </th>
+<th>
+ <p>
+ Index
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">BOOST_ASSIGN_V2_LIMIT_CSV_ARITY</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ 20
+ </p>
+ </td>
+<td>
+ <p>
+ n
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ k
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">BOOST_ASSIGN_V2_LIMIT_ARITY</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">BOOST_MPL_LIMIT_METAFUNCTION_ARITY</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ k
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ The first constant is the limit arity of a call such as
+</p>
+<pre class="programlisting"><span class="identifier">_csv_put</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]);</span>
+</pre>
+<p>
+ The second and third constants apply only to the functor form:
+</p>
+<pre class="programlisting"><span class="identifier">_put</span><span class="special">(</span> arg<span class="special">[</span><span class="number">0</span><span class="special">][</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span> arg<span class="special">[</span><span class="number">0</span><span class="special">][</span>k<span class="special">[</span><span class="number">0</span><span class="special">]])...(</span> arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span> arg<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">][</span>k<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]]);</span>
+</pre>
+<p>
+ Specifically, the second constant is the limit for arity <code class="computeroutput">k<span class="special">[</span>i<span class="special">]</span></code> under
+ which any combination of lvalue and rvalue arguments is preserved, for
+ any given <code class="computeroutput">i</code> in <code class="computeroutput"><span class="special">[</span><span class="number">0</span><span class="special">,...,</span>n<span class="special">)</span></code>.
+ Beyond this limit, all arguments are treated as either lvalues or rvalues.
+ This restriction only applies to C++03,
+ not C++0x.
+ The third constant is the total limit for arity <code class="computeroutput">k<span class="special">[</span>i<span class="special">]</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" title="Reference">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.reference"></a><a class="link" href="index.html#boost_assign_v2.dummy.reference" title="Reference">Reference</a>
+</h3></div></div></div>
+<p>
+ TODO
+ </p>
+</div>
+<div class="section" title="Runtime efficiency">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.runtime_efficiency"></a><a class="link" href="index.html#boost_assign_v2.dummy.runtime_efficiency" title="Runtime efficiency">Runtime efficiency</a>
+</h3></div></div></div>
+<p>
+ In this section, we compare the execution time of various ways to fill an
+ STL container or creating an anonymous container.
+ </p>
+<p>
+ Here are the types that are used:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">elem_</span><span class="special">;</span> <span class="comment">// T
+</span><span class="comment">// This STL container is of the same type as that internally used by the
+</span><span class="comment">// anon container of values, so we have a common basis for comparing
+</span><span class="comment">// their exec time.
+</span><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;</span> <span class="identifier">elem_</span> <span class="special">&gt;</span> <span class="identifier">cont_</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ And here are the simulation parameters:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// t is a random size element, with max size :
+</span><span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">elem_size</span> <span class="special">=</span> <span class="number">100</span><span class="special">;</span>
+<span class="comment">// Number of loops over which exec time is summed
+</span><span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">n_loops</span> <span class="special">=</span> <span class="number">1000</span> <span class="special">*</span> <span class="number">1000</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ These are the results:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Library
+ </p>
+ </th>
+<th>
+ <p>
+ Call
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 1</code>
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 2</code>
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 4</code>
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 8</code>
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 16</code>
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="literal">n = 32</code>
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ STL
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">);...</span>cont<span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.094 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.364 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.756 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.737 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.852 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">7.807 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 1.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">list_of</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.211 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">2.618 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">4.219 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">7.226 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">13.125 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">26.486 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 1.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">push_back</span><span class="special">(</span> cont <span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.251 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.726 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.709 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.780 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">7.869 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">16.117 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">csv_anon</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">...,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.252 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">2.067 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.562 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">6.363 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">12.365 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">25.760 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">anon</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span><span class="identifier">_nil</span><span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.286 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">2.160 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.663 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">6.570 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">12.559 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">25.841 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">::</span><span class="identifier">csv_anon</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1e-06 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.003 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.003 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.008 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.016 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.030 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">ref</span><span class="special">::</span><span class="identifier">assign_copy</span><span class="special">::</span><span class="identifier">anon</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.289 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.289 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.320 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.367 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.472 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.778 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">csv_put</span><span class="special">(</span> cont <span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">....,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.257 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.647 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.692 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.717 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">7.913 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">16.192 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">put</span><span class="special">(</span> cont <span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.260 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.716 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.748 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.856 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">8.040 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">16.462 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">cont <span class="special">|</span> <span class="identifier">csv_put</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">....,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.280 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.723 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.716 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.712 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">7.969 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">16.241 s</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">Boost.Assign 2.0
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">cont <span class="special">|</span> <span class="identifier">_put</span><span class="special">(</span> t<span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">)...(</span> t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.266 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">0.718 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.729 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">3.810 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">8.129 s</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">16.949 s</code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ See the <a class="link" href="index.html#boost_assign_v2.dummy.testing_platform" title="Testing platform">testing platform</a>
+ under which these results were obtained.
+ </p>
+<div class="note" title="Note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The call <code class="computeroutput"><span class="identifier">csv_put</span><span class="special">(</span>
+ cont <span class="special">)(</span> t<span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">....,</span>t<span class="special">[</span>n<span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">)</span></code> and
+ its <code class="computeroutput"><span class="identifier">_put</span></code> analog, are part
+ of the implementation of <code class="computeroutput"><span class="identifier">_csv_put</span></code>
+ and <code class="computeroutput"><span class="identifier">_put</span></code>, respectively.
+ They are given here only to gauge the overhead between these two layers
+ of code.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" title="Testing platform">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.testing_platform"></a><a class="link" href="index.html#boost_assign_v2.dummy.testing_platform" title="Testing platform"> Testing platform</a>
+</h3></div></div></div>
+<p>
+ By default, the testing plaform used for efficiency tests is
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Processor</span></dt>
+<dd><p>
+ 2.4 Ghz Intel Core 2 Duo
+ </p></dd>
+<dt><span class="term">Memory</span></dt>
+<dd><p>
+ 4GB 1067 Mhz DDR3
+ </p></dd>
+<dt><span class="term">OS</span></dt>
+<dd><p>
+ OS X 10.6.4
+ </p></dd>
+<dt><span class="term">Compiler</span></dt>
+<dd><p>
+ gcc4.2
+ </p></dd>
+<dt><span class="term">Optimization</span></dt>
+<dd><p>
+ Release | x86_64
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Portability">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.portability"></a><a class="link" href="index.html#boost_assign_v2.dummy.portability" title="Portability">Portability</a>
+</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ OS
+ </p>
+ </th>
+<th>
+ <p>
+ Compiler
+ </p>
+ </th>
+<th>
+ <p>
+ Option(s)
+ </p>
+ </th>
+<th>
+ <p>
+ Boost version(s)
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Log file
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ OS X 10.6.4
+ </p>
+ </td>
+<td>
+ <p>
+ gcc4.2
+ </p>
+ </td>
+<td>
+ <p>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.41</code>
+ </p>
+ </td>
+<td>
+ <p>
+ OK
+ </p>
+ </td>
+<td>
+ <p>
+ log_mac_gcc42
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ OS X 10.6.4
+ </p>
+ </td>
+<td>
+ <p>
+ gcc4.4 ( Fink
+ )
+ </p>
+ </td>
+<td>
+ <p>
+ C++0x
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.41</code>
+ </p>
+ </td>
+<td>
+ <p>
+ NA
+ </p>
+ </td>
+<td>
+ <p>
+ NA
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ Ubuntu 9.10
+ </p>
+ </td>
+<td>
+ <p>
+ gcc4.4
+ </p>
+ </td>
+<td>
+ <p>
+ C++0x
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">1.43</code>
+ </p>
+ </td>
+<td>
+ <p>
+ NA
+ </p>
+ </td>
+<td>
+ <p>
+ NA
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" title="Dependencies">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.dependencies"></a><a class="link" href="index.html#boost_assign_v2.dummy.dependencies" title="Dependencies">Dependencies</a>
+</h3></div></div></div>
+<p>
+ These must be in the search path:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ This directory,
+ which contains copies of files that were previously in the Vault, for chaining,
+ by RangeEx
+</li>
+<li class="listitem">
+ This directory
+ containing &lt;boost/mpl/detail/variadic.vector.hpp&gt;
+ </li>
+</ul></div>
+</div>
+<div class="section" title="Change log">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.change_log"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log" title="Change log">Change log</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__">[Proposal
+ for] Upgrading from Boost v<span class="emphasis"><em>1.4x</em></span>
+ to Boost.Assign 2.0</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization">The
+ new organization</a></span></dt>
+<dt><span class="section">Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface">The
+ new interface</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse">Code
+ reuse</a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" title="[Proposal for] Upgrading from Boost v1.4x to Boost.Assign 2.0">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__" title="[Proposal for] Upgrading from Boost v1.4x to Boost.Assign 2.0">[Proposal
+ for] Upgrading from Boost v<span class="emphasis"><em>1.4x</em></span>
+ to Boost.Assign 2.0</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization">The
+ new organization</a></span></dt>
+<dt><span class="section">Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface">The
+ new interface</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse">Code
+ reuse</a></span></dt>
+</dl></div>
+<div class="section" title="The new organization">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_organization" title="The new organization">The
+ new organization</a>
+</h5></div></div></div>
+<p>
+ The new library lives in boost/assign/v2 and its functionality is defined
+ in this namespace:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">assign</span><span class="special">::</span><span class="identifier">v2</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ The latest version prior to Boost.Assign 2.0 will continue to be supported
+ in Boost to allow backward
+ compatibility.
+ </p>
+</div>
+<div class="section" title="Rationale">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.rationale"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.rationale" title="Rationale">Rationale</a>
+</h5></div></div></div>
+<p>
+ There are two parts to this upgrade:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Entirely new features, notably <a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon" title="Anonymous container of references">anonymous
+ container of references</a>, and extended (RangeEx) methods for
+ <a class="link" href="index.html#boost_assign_v2.dummy.ug.chain" title="Adaptor _chain">chaining ranges</a>,
+ were already the subject of a mini-review
+</li>
+<li class="listitem">
+ The existing features were completly overhauled.
+ </li>
+</ol></div>
+<p>
+ The initial motivation for the overhaul is that thanks to the mini-review,
+ it was apparent that the new and old features lacked homogeneity in their
+ interface and that some newly introduced features, such as <code class="computeroutput"><span class="identifier">csv</span></code> functions (see below), had received
+ sufficient interest to warrant their generalization throughout the rest
+ of the library.
+ </p>
+<p>
+ Part of the overhaul is simply a repackaging of the old code with an
+ emphasis on code-reuse and decoupling, but a fairly different interface
+ has emerged as a result (see below). The other part comes about by exploiting
+ spillovers from some of the new features, <a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon" title="Anonymous container of references">anynomous
+ container of references</a>, to the ones we took on to revamp, resulting,
+ notably, in the <a class="link" href="index.html#boost_assign_v2.dummy.ug.put" title="Adaptors _csv_put and _put"><code class="computeroutput"><span class="identifier">_put</span></code> adaptor</a>. In this case,
+ the container of references serves as a cost-efficient buffer on the
+ right hand side of <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>.
+ </p>
+</div>
+<div class="section" title="The new interface">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.the_new_interface" title="The new interface">The
+ new interface</a>
+</h5></div></div></div>
+<p>
+ We can break down the new structure into at least two components:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Whereas the user interacted with Boost.Assign 1.0 through idiomatic
+ operators (say <code class="computeroutput"><span class="special">+=</span></code>), Boost.Assign
+ 2.0 only uses two, <code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code> and <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>, in a way that is consistent across
+ different tools:
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<code class="computeroutput"><span class="keyword">operator</span><span class="special">|</span></code>
+ expresses composable adaptors, an idea originating with <a href="http://www.boost.org/doc/libs/1_44_0/libs/range/doc/html/range/reference/adaptors.html" target="_top">range
+ adaptors</a>. Here, the result is either a (also) different
+ type of range or the container passed as an input, but in a new
+ state. See, for example, the synopsis of <a class="link" href="index.html#boost_assign_v2.dummy.ug.put_range" title="Adaptor _put_range">_put_range</a>
+</li>
+<li class="listitem">
+ Traits take care of making certain decisions about the implementation.
+ These choices, however, can be overriden by passing parameters
+ with <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>.
+ See, for example, the synopsis of the <a class="link" href="index.html#boost_assign_v2.dummy.ug.put" title="Adaptors _csv_put and _put"><code class="computeroutput"><span class="identifier">_put</span></code> adaptor</a>
+</li>
+</ul></div>
+</li>
+<li class="listitem">
+ Many tools come in two flavors : as a functor that forwards, say, to
+ a constructor, or as functions, identified by suffix <code class="computeroutput"><span class="identifier">csv</span></code>, oveloaded on the number of arguments.
+ This dichotomy should be quite obvious from looking at the synopsis
+ of, for example, of <a class="link" href="index.html#boost_assign_v2.dummy.ug.anon" title="Anonymous container of values">anonymous
+ container of values</a>
+</li>
+</ol></div>
+<p>
+ An issue that was touched upon during the mini-review
+ is that of creating an empty container. The custom in Boost.Assign 1.0
+ was to reserve the nullary <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code> for default constructinging a value,
+ for example, <code class="computeroutput"><span class="identifier">list_of</span><span class="special">&lt;</span>T<span class="special">&gt;(</span> x
+ <span class="special">)()(</span> z <span class="special">)</span></code>.
+ Some felt, however, that <code class="computeroutput"><span class="identifier">list_of</span><span class="special">&lt;</span>T<span class="special">&gt;()</span></code>
+ should return an empty container. To resolve this dilemma, Boost.Assign
+ 2.0 keeps the old convention, but creates a new one for expressing the
+ initialization of an empty container. Since <code class="computeroutput"><span class="identifier">list_of</span><span class="special">()</span></code> is now <code class="computeroutput"><span class="identifier">anon</span><span class="special">()</span></code>, it is,
+</p>
+<pre class="programlisting"><span class="identifier">anon</span><span class="special">&lt;</span>T<span class="special">&gt;(</span> <span class="identifier">_nil</span> <span class="special">);</span>
+</pre>
+<p>
+ The same applies to the <code class="computeroutput"><span class="identifier">csv</span></code>
+ form, and <a class="link" href="index.html#boost_assign_v2.dummy.ug.ref_anon" title="Anonymous container of references">anonymous
+ container of references</a>.
+ </p>
+<p>
+ Note that the function <code class="computeroutput"><span class="identifier">list_of</span><span class="special">()</span></code> was renamed to <code class="computeroutput"><span class="identifier">anon</span><span class="special">()</span></code> for the following reasons: a) <code class="computeroutput"><span class="identifier">list_of</span></code> evoques a particular data-structure
+ that, in fact, is not the underlying one, which is a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special">&lt;&gt;</span></code>.b) In the previous documentation
+ the result of <code class="computeroutput"><span class="identifier">list_of</span></code>
+ was referred to as an anon-ymous container. The new name is therefore
+ consistent with this practice. ]
+ </p>
+</div>
+<div class="section" title="Code reuse">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse"></a><a class="link" href="index.html#boost_assign_v2.dummy.change_log.__proposal_for___upgrading_from___boost___v__1_4x__to___boost_assign_v2__.code_reuse" title="Code reuse">Code
+ reuse</a>
+</h5></div></div></div>
+<p>
+ The structure of Boost.Assign 1.0 is similar to that of Boost.Assign
+ 2.0 if one looks at low level. At the high level, explaining the evolution
+ from one to the other is arduous task so we will touch on a few items.
+ </p>
+<p>
+ <span class="emphasis"><em>List inserters</em></span> in Boost.Assign 1.0, such as <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>,
+ and <code class="computeroutput"><span class="identifier">list_of</span><span class="special">()</span></code>
+ now have counterparts, the <a class="link" href="index.html#boost_assign_v2.dummy.ug.put" title="Adaptors _csv_put and _put"><code class="computeroutput"><span class="identifier">put</span></code> adaptor</a> and <code class="computeroutput"><span class="identifier">anon</span><span class="special">()</span></code>,
+ respectively, we now share a significant proportion of common code expressed
+ by a crtp
+ class. Already, <code class="computeroutput"><span class="identifier">anon</span><span class="special">()</span></code> can now work with any <a class="link" href="index.html#boost_assign_v2.dummy.ug.put.std_modifier" title="Standard modifier">modifier</a>,
+ whereas previously <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> was the default and only implementation.
+ </p>
+<p>
+ Moreover, modifiers are now defined outside the crtp
+ class, the latter only keeping a (compile time) tag specifying which
+ modifier to forward to. This makes it easy to develop new ones, besides
+ the standard ones (e.g. <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>), of course, as they are already defined.
+ One example of a non-standard modifier is the modifier <a class="link" href="index.html#boost_assign_v2.dummy.ug.put.ext_func.repeat" title="Repeating an argument"><code class="computeroutput"><span class="identifier">_repeat</span></code></a>.
+ </p>
+<p>
+ The second dimension of the new framework is <a class="link" href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding" title="Argument forwarding">argument
+ forwarding</a>, which was already present, for example, as part of
+ <code class="computeroutput"><span class="identifier">list_of</span><span class="special">()</span></code>.
+ What is entirely new, is that a traits mecanism takes care of deciding
+ which modifier-functor pair to use. As a result, passing a key and data
+ as two arguments (as opposed to pairing them first with <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;&gt;</span></code>)
+ to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;&gt;</span></code>
+ works seamlessly, as illustrated <a class="link" href="index.html#boost_assign_v2.dummy.ug.put.arg_forwarding.auto" title="Automatic deduction">here</a>,
+ whereas previously, a dedicated function was needed, <code class="computeroutput"><span class="identifier">map_list_of</span><span class="special">()</span></code>.
+ </p>
+<p>
+ Again, we can override the default choices by passing as many parameters
+ as necessary with <code class="computeroutput"><span class="keyword">operator</span><span class="special">%</span></code>. A complex example is given here.
+ </p>
+<p>
+ Pointer containers required three seperated implementations, <code class="computeroutput"><span class="identifier">ptr_list_of</span><span class="special">()</span></code>,
+ <code class="computeroutput"><span class="identifier">ptr_map_insert</span><span class="special">()</span></code>,
+ <code class="computeroutput"><span class="identifier">ptr_map_list_of</span><span class="special">()</span></code>
+ whereas now they are integrated in the new framewok, requiring few lines
+ of extra-code to accomodate them, and without any change to the user
+ interface, compared to value-containers. TODO make sure the old functionality
+ is covered by the new one.
+ </p>
+<p>
+ On the topic of <a class="link" href="index.html#boost_assign_v2.dummy.ug.conversion" title="Conversion">conversion</a>,
+ the functionality that allowed to convert the result of <code class="computeroutput"><span class="identifier">list_of</span><span class="special">()</span></code>
+ to an arbitrary container, is now a free function with to arguments,
+ the input and the output. Using it as a standalone is, in itself, an
+ advantage, but also, it is now integrated into several objects defined
+ in this library.
+ </p>
+</div>
+</div>
+</div>
+<div class="section" title="Support">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.support"></a><a class="link" href="index.html#boost_assign_v2.dummy.support" title="Support">Support</a>
+</h3></div></div></div>
+<p>
+ For support, post to the <a href="http://www.boost.org/community/groups.html#users" target="_top">Boost
+ Users Mailing List</a>, and CC TO
+ and <a href="mailto:erDOTciDOT2020ATgmailDOTcom" target="_top">ER</a>.
+ </p>
+</div>
+<div class="section" title="History and acknowledgement">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.history_and_acknowledgement"></a><a class="link" href="index.html#boost_assign_v2.dummy.history_and_acknowledgement" title="History and acknowledgement">History
+ and acknowledgement</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v1__">Boost.Assign
+ 1.0</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v2___">Boost.Assign
+ 2.0 </a></span></dt>
+</dl></div>
+<div class="section" title="Boost.Assign 1.0">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v1__"></a><a class="link" href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v1__" title="Boost.Assign 1.0">Boost.Assign
+ 1.0</a>
+</h4></div></div></div>
+<p>
+ The idea for an assignment/initialization library is not new. The functionality
+ of this library resembles Leor Zolman's STL Container Initialization Library
+ a great deal, but it does not rely on string parsing to achieve its goals.
+ </p>
+<p>
+ Special thanks go to
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Leor Zolman for our many discussion that eventually led to this library.
+ </li>
+<li class="listitem">
+ Tom Brinkman for being review manager.
+ </li>
+<li class="listitem">
+ Joaqu&#237;n Mu&#241;oz for vc6/vc7 portability.
+ </li>
+<li class="listitem">
+ Pavel Vozenilek for his countless suggestions, improvements and portability
+ fixes.
+ </li>
+<li class="listitem">
+ Rene Rivera for Code Warrior portability.
+ </li>
+</ul></div>
+</div>
+<div class="section" title="Boost.Assign 2.0">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v2___"></a><a class="link" href="index.html#boost_assign_v2.dummy.history_and_acknowledgement.__boost_assign_v2___" title="Boost.Assign 2.0">Boost.Assign
+ 2.0 </a>
+</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Manuel Peinado Gallego identified the need for an anonymous container
+ of references, and provided valuable advice throughout the early development
+ of Boost.Assign 2.0, such as proposing a design
+ that laid the foundation for <a class="link" href="index.html#boost_assign_v2.dummy.ug.chain" title="Adaptor _chain">chaining</a>.
+ </li></ul></div>
+</div>
+</div>
+<div class="section" title="Bibliography">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_assign_v2.dummy.bibliography"></a><a class="link" href="index.html#boost_assign_v2.dummy.bibliography" title="Bibliography">Bibliography</a>
+</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Scott. Meyers, "More Effective C++", Item 7, Addison Wesley,
+ 1996
+ </li>
+<li class="listitem">
+ K. Czarnecki and U.W. Eisenecker, "Generative programming", Addison-Wesley,
+ 2000
+ </li>
+<li class="listitem">Blitz</li>
+<li class="listitem">
+ Gabriel Dos Reis and Bjarne Stroustrup, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1509.pdf" target="_top">Generalized
+ Initializer Lists</a>, 2003
+ </li>
+<li class="listitem">
+ Abrahams, David and Gurtovoy, Aleksey, <a href="http://portal.acm.org/citation.cfm?id=1044941#" target="_top">C++
+ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and
+ Beyond (C++ in Depth Series)</a>, 2004, Addison-Wesley Professional.
+ </li>
+</ul></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: November 12, 2010 at 02:32:14 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"></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