Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60598 - in sandbox/statistics/detail/assign: boost/assign/auto_size/chain libs/assign/doc libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-14 20:02:23


Author: e_r
Date: 2010-03-14 20:02:22 EDT (Sun, 14 Mar 2010)
New Revision: 60598
URL: http://svn.boost.org/trac/boost/changeset/60598

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp | 4 ++--
   sandbox/statistics/detail/assign/libs/assign/doc/index.html | 40 ++++++++++++++++++++++------------------
   sandbox/statistics/detail/assign/libs/assign/example/chain.cpp | 21 +++++++++++----------
   3 files changed, 35 insertions(+), 30 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp 2010-03-14 20:02:22 EDT (Sun, 14 Mar 2010)
@@ -6,8 +6,8 @@
 // Boost Software License, Version 1.0. (See accompanying file //
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
 //////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_ASSIGN_DETAIL_CHAIN_CONVERT_ER_2010_HPP
-#define BOOST_ASSIGN_DETAIL_CHAIN_CONVERT_ER_2010_HPP
+#ifndef BOOST_ASSIGN_DETAIL_CHAIN_CONVERT_ER_MPG_2010_HPP
+#define BOOST_ASSIGN_DETAIL_CHAIN_CONVERT_ER_MPG_2010_HPP
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/not.hpp>
 #include <boost/range.hpp>

Modified: sandbox/statistics/detail/assign/libs/assign/doc/index.html
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/doc/index.html (original)
+++ sandbox/statistics/detail/assign/libs/assign/doc/index.html 2010-03-14 20:02:22 EDT (Sun, 14 Mar 2010)
@@ -38,7 +38,7 @@
             <li>Function map_list_of()
             <li>Function tuple_list_of()
             <li>Functions repeat(), repeat_fun() and range()
- <li>Function chain_auto_convert()
+ <li>Function chain_convert()
             <li>Functions ref_list_of(), cref_list_of() and variants
             <li>Functions ref_csv(), cref_csv() and variants
             <li>A "complicated" example
@@ -64,7 +64,7 @@
         <li>Functions repeat(), repeat_fun() and
                                                                       <a href="#ref-repeat"><code>range()</code>
                                                                       </a></li>
- <li>Function chain_auto_convert()</li>
+ <li>Function chain_convert()</li>
        <li>Customizing argument list sizes </li>
      </ul>
     <li>
@@ -475,25 +475,25 @@
 
 </p>
 
-<h3>Function <code>chain_auto_convert()</code> <a name="chain_auto_convert"></h3>
+<h3>Function <code>chain_convert()</code> <a name="chain_convert"></h3>
 
 While the function range() works in combination with functions
 such as list_of(), it is not compatible with
 <a href="#ref_csv"><code>ref_csv()</code></a>, <a href="#ref_list"><code>ref_list_of()</code></a> and their variants,
-which are part of a different framework. The function <code>chain_auto_convert()</code>,
+which are part of a different framework. The function <code>chain_convert()</code>,
 however, achieves a similar goal. Continuing the example above,
 
 
-<blockquote><pre><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>auto_size</span><span class=special>/</span><span class=identifier>chain_auto_convert</span><span class=special>.</span><span class=identifier>hpp</span><span class=special>&gt;</span>
+<blockquote><pre><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>auto_size</span><span class=special>/</span><span class=identifier>chain_convert</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>auto_size</span><span class=special>/</span><span class=identifier>ref_list_of</span><span class=special>.</span><span class=identifier>hpp</span><span class=special>&gt;</span>
  
 <span class=special>{</span>
- <span class=identifier>BOOST_ASSERT</span><span class=special>( </span><span class=identifier>chain_auto_convert</span><span class=special>(</span>
- </span><span class=identifier>ref_list_of</span>(</span><span class=identifier>x</span><span class=special>).</span><span class=identifier>chain_auto_convert</span><span class=special>(</span><span class=identifier>v2</span><span class=special>)</span><span class=special> , </span><span class=identifier>ref_list_of</span>(</span><span class=identifier>y</span><span class=special>)</span> <span class=special>)</span><span class=special>.</span><span class=identifier>size</span><span class=special>(</span><span class=special>)</span><span class=special> == </span><span class=number>10u</span><span class=special> )</span><span class=special>;</span>
+ <span class=identifier>BOOST_ASSERT</span><span class=special>(
+ </span><span class=identifier>chain_convert_r</span><span class=special>( </span></span><span class=identifier>ref_list_of</span>( </span><span class=identifier>x</span><span class=special> )</span><span class=special> )</span><span class=special>( </span><span class=identifier>v2</span><span class=special> )( </span><span class=identifier>ref_list_of</span>(</span><span class=identifier>y</span><span class=special>)</span> <span class=special>)</span><span class=special>.</span><span class=identifier>size</span><span class=special>(</span><span class=special>)</span><span class=special> == </span><span class=number>10u</span><span class=special> )</span><span class=special>;</span>
 <span class=special>}</span></pre>
 </blockquote>
 
-The reference is here.
+Notice the suffix 'r' which tells the functions that the arguments should be treated as rvalues. The reference is here.
 
 <h3>Functions <code>ref_list_of()</code>, <code>cref_list_of()</code> <a name="ref_list_of"> and variants</h3>
 
@@ -832,7 +832,7 @@
         <li>Functions repeat(), repeat_fun() and
                                                                       <a href="#ref-repeat"><code>range()</code>
                                                                       </a></li>
- <li>Function chain_auto_convert()</li>
+ <li>Function chain_convert()</li>
         <li>Customizing argument list sizes </li>
      </ul>
 
@@ -850,7 +850,7 @@
 
      <tr>
          <td> &lt;boost/assign/auto_size/chain/auto_convert.hpp> </td>
- <td> chain_auto_convert()
+ <td> chain_convert()
 
      <tr>
          <td> &lt;boost/assign/auto_size/ref_csv.hpp> </td>
@@ -1146,7 +1146,7 @@
   </p>
 
 
- <h3>Function <code>chain_auto_convert()</code> <a name="ref-chain_auto_convert"> </h3>
+ <h3>Function <code>chain_convert_l()</code> and <code>chain_convert_r() <a name="ref-chain_convert"> </h3>
   
   <p> This function joins two ranges into one whose dereferenced type is one that is convertible
   to from those of the two input ranges. In particular, either range may contain reference wrappers
@@ -1158,8 +1158,7 @@
   <blockquote>
           <table cellpadding=5 border=1>
           <tr><th class="head">Parameter</th> <th class="head">Description</th>
- <tr><td><tt>R1</tt></td><td>First argument</td></tr>
- <tr><td><tt>R2</tt></td><td>Second argument</td></tr>
+ <tr><td><tt>R</tt></td><td>Range</td></tr>
           </table>
   </blockquote>
 
@@ -1168,12 +1167,13 @@
   <p>To be defined </p>
 
   <b>Usage</b>
- <p>Let <code>r1</code> and <code>r2</code> be instances of <code>R1</code> and <code>R2</code> </p>
+ <p>Let <code>r</code> instance of <code>R</code>
 
   <blockquote>
           <table cellpadding=5 border=1>
           <tr><th class="head">Expression</th> <th class="head">Result</th>
- <tr><td><tt>chain_auto_convert(r1,r2)</tt></td><td>A range joining <code>r1</code> and <code>r2</code> </td></tr>
+ <tr><td><tt>chain_convert_l(r)</tt></td><td> adaptor_chain_convert_l<R> </td></tr>
+ <tr><td><tt>chain_convert_r(r)</tt></td><td> adaptor_chain_convert_r<R> </td></tr>
           </table>
   </blockquote>
 
@@ -1549,7 +1549,6 @@
           <table cellpadding=5 border=1>
           <tr><th class="head">Expression</th> <th class="head">Description</th>
           <tr><td><tt>R&lt;T&gt;</tt></td><td> Reference wrapper </td> </tr>
- <tr><td>chain_as_member<></td><td> Public base class of array_interface<></td> </tr>
           <tr><td>converter<></td><td> Public base class of array_interface<></td> </tr>
           </table>
   </blockquote>
@@ -1705,9 +1704,14 @@
    The successive arguments that are passed to the unary operator must be allocated on the stack.
    Consequently, this set up is ill-suited for the method range() whose argument size must
    be specified explicitly, unlike the remainder of this library. As long as the policy
- exposes iterators, however, it is interoperable with the function chain_auto_convert() which
- serves a similar purpose.
+ exposes iterators, however, it is interoperable with the function chain_convert_l()
+ and chain_convert_r(), which serve a similar purpose.
 </p>
+
+ <h3><a name="ref-adaptor_chain_convert">Proxy objects <code>adaptor_chain_convert_l&lt;&gt;</code> and <code>adaptor_chain_convert_r&lt;&gt;</code> </a> </h3>
+
+ To be defined.
+
   <h3><a name="ref-lazy_array">Proxy object <code>lazy_array&lt;&gt;</code></a></h3>
   <b>Header</b> <code>&lt;boost/assign/auto_size/array/lazy.hpp></code>
 

Modified: sandbox/statistics/detail/assign/libs/assign/example/chain.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/chain.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/chain.cpp 2010-03-14 20:02:22 EDT (Sun, 14 Mar 2010)
@@ -31,31 +31,32 @@
     ar_ ar2; ar2.assign( 0 );
     ar_ ar3; ar3.assign( 1 );
     ar_ ar4; ar4.assign( 2 );
+ ar_ ar5; ar5.assign( 3 );
         BOOST_AUTO(tmp1,ref_list_of(a)(b)(c)(d));
         BOOST_AUTO(tmp2,ref_list_of(e)(f)(g)(h));
 
-
     boost::copy(
- chain_convert_r(tmp2)(ar4),
+ chain_convert_r(tmp2)(ar4)(ar5),
         std::ostream_iterator<val_>(os," ")
- ); os << " --- becomes ---> ";
+ ); os << " --- becomes ---> " << std::endl;
 
     boost::copy(
- chain_convert_r(tmp1)(ar2),
- boost::begin(chain_convert_l(tmp2)(ar4))
+ chain_convert_r(tmp1)(ar2)(ar3),
+ boost::begin(chain_convert_l(tmp2)(ar4)(ar5))
     );
 
     boost::copy(
- chain_convert_r(tmp2)(ar4),
+ chain_convert_r(tmp2)(ar4)(ar5),
         std::ostream_iterator<val_>(os," ")
- ); os << " --- that should equal ---> ";
+ ); os << " --- that should equal ---> "<< std::endl;
 
     boost::copy(
- chain_convert_r(ref_list_of(a)(b)(c)(d))(ar2),
+ chain_convert_r(ref_list_of(a)(b)(c)(d))(ar2)(ar3),
         std::ostream_iterator<val_>(os," ")
- ); os << " ---, half segments interverted ---> ";
+ ); os << " ---, tier segments in reverse order ---> " << std::endl;
+
     boost::copy(
- chain_convert_r(ref_list_of(a)(b)(c)(d))(ar2),
+ chain_convert_r(ar3)(ar2)(ref_list_of(a)(b)(c)(d)),
         std::ostream_iterator<val_>(os," ")
     ); // this is a case where without _r, there would be compile error
 


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