Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61253 - in sandbox/statistics/detail/assign: boost/assign/auto_size boost/assign/auto_size/range libs/assign/doc libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-04-13 14:47:08


Author: e_r
Date: 2010-04-13 14:47:07 EDT (Tue, 13 Apr 2010)
New Revision: 61253
URL: http://svn.boost.org/trac/boost/changeset/61253

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/converter.hpp | 11 ++++---
   sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp | 1
   sandbox/statistics/detail/assign/libs/assign/doc/index.html | 60 +++++++++++++++++++++++++++------------
   sandbox/statistics/detail/assign/libs/assign/example/range.cpp | 2 +
   4 files changed, 49 insertions(+), 25 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/converter.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/converter.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/converter.hpp 2010-04-13 14:47:07 EDT (Tue, 13 Apr 2010)
@@ -19,11 +19,6 @@
 
 
 #define BOOST_ASSIGN_AS_CONVERTER(R) \
- template< class Container > \
- operator Container() const \
- { \
- return this->convert_to_container<Container>(); \
- } \
     template< class Container> \
     Container convert_to_container() const{ \
         return range_convert::convert_to_container<Container>(*this); } \
@@ -41,6 +36,12 @@
                                                                                \
     template<class Array> Array to_array( Array& a) const{ \
         return to_array(a,*this); } \
+ \
+ template< class Container > \
+ operator Container() const \
+ { \
+ return this->convert_to_container<Container>(); \
+ } \
 /**/
     
 namespace boost{

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp 2010-04-13 14:47:07 EDT (Tue, 13 Apr 2010)
@@ -41,7 +41,6 @@
         return detail::auto_size::first_copy<const T>::call(t);
     }
 
-
     template<typename T>
     typename detail::auto_size::first_copy<T>::type
     ref_list_of(T& t){

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-04-13 14:47:07 EDT (Tue, 13 Apr 2010)
@@ -82,12 +82,13 @@
         <li> Proxy object static_array<> </li>
      </ul>
     <li> Exceptions and exception-safety </li>
- <li> Extending the library
- <li> Supported libraries
- <li> Examples</li> <ul></ul>
- <li>Portability</li>
- <li>History and Acknowledgment
- <li>References</li>
+ <li> Extending the library</li>
+ <li> Supported libraries </li>
+ <li> Examples</li>
+ <li> Portability</li>
+ <li> History and Acknowledgment</li>
+ <li> Upgrading from Boost v. 1.42</li>
+ <li> References</li>
   </ul>
   <hr>
 
@@ -98,8 +99,9 @@
 Stroustrup</b>, The Design and Evolution of C++ </p> <p> The purpose of this
 library is to make it easy to fill containers with data by overloading
 <code>operator,()</code> and <code>operator()()</code>. These two operators
-make it possible to construct lists of values that are then copied into a
-container: </p> <ul> <li> A comma-separated list: <p>
+make it possible to construct lists of values with range and/or conversion capabilities:
+</p>
+<ul> <li> A comma-separated list: <p>
        <!-- vector< int > v; v += 1,2,3,4,5,6,7,8,9; -->
  
 <pre><span
@@ -123,6 +125,21 @@
 class=identifier>string</span><span class=special>,</span><span class=keyword>int</span><span class=special>> </span><span class=identifier>m</span><span class=special>; </span>
 <span class=identifier>insert</span><span class=special>( </span><span class=identifier>m </span><span class=special>)( </span><span class=string>&quot;Bar&quot;</span><span class=special>, </span><span class=number>1 </span><span class=special>)( </span><span class=string>&quot;Foo&quot;</span><span class=special>, </span><span class=number>2 </span><span class=special>);</span></pre>
     </ul>
+
+<ul> <li> A list of references (to temporaries, in this example): <p>
+ <pre><span class=special>boost::array&lt;<span class=keyword>int</span><span class=special>,</span><span class=number>9</span>&gt; </span><span class=identifier>a</span> <span class=special>= </span><span class=identifier>cref_csv</span><span class=special>( </span><span
+class=number>1</span><span
+class=special>,</span><span class=number>2</span><span
+class=special>,</span><span class=number>3</span><span
+class=special>,</span><span class=number>4</span><span
+class=special>,</span><span class=number>5</span><span
+class=special>,</span><span class=number>6</span><span
+class=special>,</span><span class=number>7</span><span
+class=special>,</span><span class=number>8</span><span
+class=special>,</span><span class=number>9</span><span class=special> )</span></pre>
+</p> </ul>
+
+
 <p>
     These lists are particularly useful in
     learning, testing, and prototyping situations, but can also be handy otherwise.
@@ -815,9 +832,8 @@
   <p> This section is about proxy objects that are in <code>boost::assign::detail::auto_size</code>. The functions
   that return them, however, ref_list_of(), ref_csv()
   and their variants, operate under the same principle as those in the rest of this library and are therefore in namespace <code>boost::assign</code>.
- In this framework, nested compile time expressions are formed from references to passed argument, and fitted, as needed, with iterators and
- conversion operations. This is in contrast to other parts of this library, where a passed argument is either directly inserted into its destination
- container or stored in a runtime-fashion.
+ Compile time expressions are formed from references to passed argument, which frees the user from the need to specify the
+ size of the collection explicitly.
   </p>
 
   <h2>Reference for functions and operators <a name="ref-functions"> </h3>
@@ -2042,10 +2058,6 @@
 support better initialization (see [4]).
   </p>
   
- <p>
- The auto-size framework for building a collection of references whose size is deduced at compile time
- was added in 2010.
- </p>
   
   <p>
   Special thanks goes to
@@ -2056,13 +2068,23 @@
   <li> Pavel Vozenilek for his countless suggestions, improvements and
        portability fixes.
   <li> Rene Rivera for Code Warrior portability.
- <li> Manuel Peinado Gallego for valuable discussions related to the auto-size framework.
- In particular, he identified the need to distinguish between copy and rebind semantics and first developed and
- first proposed a design that laid the foundation for
- chain_l and auto-size framework,
+ his valuable advice in its development, and proposing
+ a design that laid the foundation for
+ chain_l and chain_l .
        
        </ul>
   </p>
+
+ <hr>
+ <h2><a name="upgrading_from_1_42">Upgrading from Boost v. <span class=number>1</span><span class=special>.</span><span class=number>42</span></a></h2>
+
+ <p>
+ The auto-size framework for building a collection of references whose size is deduced at compile time supersedes ref_list_of<int>().
+ The latter will continue to be supported to ensure backward compatibility.
+ </p>
+
+
   <hr>
   <h2><a name="ref">References</a></h2>
   <p>

Modified: sandbox/statistics/detail/assign/libs/assign/example/range.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/range.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/range.cpp 2010-04-13 14:47:07 EDT (Tue, 13 Apr 2010)
@@ -35,6 +35,8 @@
 
     typedef boost::array<detail::assign_reference_copy<val_>,1> ref_array_;
 
+ ar1 = ref_list_of(a)(b);
+
 {
 /*
 


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