Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60835 - in sandbox/statistics/detail/assign: boost/assign/auto_size/check boost/assign/auto_size/comparison_op boost/assign/auto_size/detail boost/assign/auto_size/range libs/assign/doc libs/assign/example libs/assign/src
From: erwann.rogard_at_[hidden]
Date: 2010-03-25 21:55:42


Author: e_r
Date: 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
New Revision: 60835
URL: http://svn.boost.org/trac/boost/changeset/60835

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain_convert_l.hpp | 16 ++++++------
   sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp | 2
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp | 2
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp | 23 ++++++++++++++----
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp | 38 ++++++++++++++++++------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp | 4 +-
   sandbox/statistics/detail/assign/libs/assign/doc/index.html | 49 +++++++++++++++++++++++++++++++++++++--
   sandbox/statistics/detail/assign/libs/assign/example/range.cpp | 13 ++++-----
   sandbox/statistics/detail/assign/libs/assign/src/main.cpp | 18 +++++++-------
   9 files changed, 114 insertions(+), 51 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain_convert_l.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain_convert_l.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain_convert_l.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -41,28 +41,28 @@
     BOOST_AUTO(tmp1,BOOST_ASSIGN_AS_CHECK_ref3(a1,b1,c1)); \
     BOOST_AUTO(tmp2,BOOST_ASSIGN_AS_CHECK_ref3(d1,e1,f1)); \
     BOOST_AUTO(tmp3,BOOST_ASSIGN_AS_CHECK_ref2(g1,h1)); \
- boost::copy(ar, boost::begin(chain_convert_l(ar1)(ar2)(ar3))); \
+ boost::copy(ar, boost::begin(chain_l(ar1)(ar2)(ar3))); \
     check_values_impl( \
         ar1[0],ar1[1],ar1[2],ar2[0],ar2[1],ar2[2],ar3[0],ar3[1]); \
- boost::copy(ar, boost::begin(chain_convert_l(ar1)(ar2)(tmp3))); \
+ boost::copy(ar, boost::begin(chain_l(ar1)(ar2)(tmp3))); \
     check_values_impl( \
         ar1[0],ar1[1],ar1[2],ar2[0],ar2[1],ar2[2], g1 , h1 ); \
- boost::copy(ar, boost::begin(chain_convert_l(ar1)(tmp2)(ar3))); \
+ boost::copy(ar, boost::begin(chain_l(ar1)(tmp2)(ar3))); \
     check_values_impl( \
         ar1[0],ar1[1],ar1[2], d1 , e1 , f1 ,ar3[0],ar3[1]); \
- boost::copy(ar, boost::begin(chain_convert_l(ar1)(tmp2)(tmp3))); \
+ boost::copy(ar, boost::begin(chain_l(ar1)(tmp2)(tmp3))); \
     check_values_impl( \
         ar1[0],ar1[1],ar1[2], d1 , e1 , f1 , g1 , h1 ); \
- boost::copy(ar, boost::begin(chain_convert_l(tmp1)(ar2)(ar3))); \
+ boost::copy(ar, boost::begin(chain_l(tmp1)(ar2)(ar3))); \
     check_values_impl( \
         a1 , b1 , c1 ,ar2[0],ar2[1],ar2[2],ar3[0],ar3[1]); \
- boost::copy(ar, boost::begin(chain_convert_l(tmp1)(ar2)(tmp3))); \
+ boost::copy(ar, boost::begin(chain_l(tmp1)(ar2)(tmp3))); \
     check_values_impl( \
         a1 , b1 , c1 ,ar2[0],ar2[1],ar2[2], g1 , h1 ); \
- boost::copy(ar, boost::begin(chain_convert_l(tmp1)(tmp2)(ar3))); \
+ boost::copy(ar, boost::begin(chain_l(tmp1)(tmp2)(ar3))); \
     check_values_impl( \
         a1 , b1 , c1 , d1 , e1 , f1 ,ar3[0],ar3[1]); \
- boost::copy(ar, boost::begin(chain_convert_l(tmp1)(tmp2)(tmp3))); \
+ boost::copy(ar, boost::begin(chain_l(tmp1)(tmp2)(tmp3))); \
     check_values_impl( \
         a1 , b1 , c1 , d1 , e1 , f1 , g1 , h1 ); \
 } \

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -22,7 +22,7 @@
     // Let L and R model Range. For either of (L xor R) in G or (L and R) in G,
     // Expression Returns
     // l == r ::boost::iterator_range_detail::equal( l, r )
- // l < r ::boost::iterator_range_detail::less_than( l, r );
+ // l < r ::boost::iterator_range_detail::less_than( l, r )
     // The remaining operators, !=, >,<=,>= are defined using their
     // relationships to the two fundamental ones.
     struct fundamental_policy{

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -48,7 +48,7 @@
 // with M.P.G
 //
 // range<int>() is provided to achieve conformity with the rest of Boost.Assign
-// but it is in fact ill suited here. See chain_convert_l() and
+// but it is in fact ill suited here. See chain_l() and
 // chain_convert_r() as an alternative.
 
 namespace boost{

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -16,7 +16,6 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/range/chain.hpp>
 #include <boost/assign/auto_size/range/result_of_chain.hpp>
-#include <boost/assign/auto_size/range/hold_previous.hpp>
 
 // This is based on
 // http://gist.github.com/287791
@@ -28,7 +27,7 @@
 // three also have to.
 
 namespace boost{
-namespace assign{
+namespace range{
 namespace detail{
 namespace chain_impl{
 
@@ -57,12 +56,26 @@
         typedef boost::sub_range<sel_r1_> type;
     };
                       
+ template<typename E,bool is_first>
+ class hold_previous{
+ typedef typename boost::mpl::if_c<is_first,E,E&>::type previous_;
+
+ public:
+
+ hold_previous(){}
+ hold_previous(E& p)
+ :previous(p){}
+
+ mutable previous_ previous;
+ };
+
     template<typename E,bool is_first,bool add_const>
     struct sel_hold_previous : boost::mpl::if_c<
         add_const,
         boost::mpl::empty_base,
- detail::hold_previous<E,is_first>
+ hold_previous<E,is_first>
>{};
+
                       
     template<typename E,typename R1,bool is_first,bool add_const>
         class expr :
@@ -121,7 +134,7 @@
             typedef typename result_impl<R2>::type res_;
             return res_(*this,r2);
         }
-
+
     };
 
     template<typename R1,bool add_const>
@@ -150,7 +163,7 @@
         return caller_::call(r1);
     }
 
-}// assign
+}// range
 }// boost
 
 #endif
\ No newline at end of file

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -28,7 +28,7 @@
 #include <boost/type_traits/is_reference.hpp> // tmp
 
 // Usage : Let r1, r2 and r3 denote lvalue-ranges.
-// boost::copy( input, boost::begin( chain_convert_l(r1)(r2)(r3) ) );
+// boost::copy( input, boost::begin( chain_l(r1)(r2)(r3) ) );
 // This function does not have the restriction of chain_l that none or all
 // of r1, r2, r3 must be reference wrappers.
 
@@ -40,7 +40,7 @@
     // ---- template parameters ---- //
 
     // L : converted_range::list<> or empty base if rvalue
- // E : chain_impl::expr<>
+ // E : range::detail::chain_impl::expr<>
     // Rng1 : a range to chain to
     // is_first : indicator
     // V : a value conversion parameter
@@ -58,7 +58,7 @@
         bool is_first,typename V,typename R,bool add_const>
     struct impl_of_expr
     {
- typedef typename chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
         typedef typename
             detail::result_of::convert_range<cr1_,V,R>::type conv_r1_;
         typedef typename E::template result_impl<conv_r1_>::type type;
@@ -67,9 +67,9 @@
     template<typename E,typename Rng1,typename V,typename R,bool add_const>
     struct impl_of_expr<E,Rng1,true,V,R,add_const>
     {
- typedef typename chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
         typedef typename result_of::convert_range<cr1_,V,R>::type conv_r1_;
- typedef typename chain_impl::first_expr<conv_r1_,add_const>::type type;
+ typedef typename range::detail::chain_impl::first_expr<conv_r1_,add_const>::type type;
     };
 
     typedef boost::mpl::void_ top_;
@@ -100,8 +100,6 @@
         typedef typename sel_list<L,Rng1,is_first,V,R,add_const>::type list_;
         typedef typename impl_of_expr<E,Rng1,
            is_first,V,R,add_const>::type impl_;
-
- public:
                 
         // types
         typedef V conversion_value;
@@ -158,6 +156,16 @@
             );
         }
 
+ // conversion
+
+ // TODO implement all conversion capabilities
+
+ template< class Container >
+ operator Container() const
+ {
+ return Container(boost::begin(*this),boost::end(*this));
+ }
+
     };
 
     // ---- traits ---- //
@@ -165,7 +173,7 @@
     template<typename Rng1,typename V,typename R, bool add_const>
     struct first_expr{
         typedef chain_convert_impl::expr<top_,top_,Rng1,1,V,R,add_const> type;
- typedef typename chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
         static type call(cr1_& r1){ return type(r1); }
     };
 
@@ -187,7 +195,7 @@
         typedef typename boost::range_reference<Rng1>::type from_;
         typedef typename reference_traits::convert_to<from_>::type ref_to_;
         typedef typename boost::remove_reference<ref_to_>::type to_;
- typedef typename chain_impl::sel_const<to_,add_const>::type type;
+ typedef typename range::detail::chain_impl::sel_const<to_,add_const>::type type;
     };
 
 }// chain_convert_l_impl
@@ -197,7 +205,7 @@
 
     template<typename V,typename R,typename Rng1>
     typename detail::chain_convert_impl::first_expr_l<Rng1,V,R>::type
- chain_convert_l(Rng1& r1,
+ chain_l(Rng1& r1,
         typename boost::disable_if<boost::is_same<R,use_default> >::type* = 0
     ){
         typedef detail::chain_convert_impl::first_expr_l<Rng1,V,R> caller_;
@@ -206,7 +214,7 @@
 
     template<typename V,typename R,typename Rng1>
     typename detail::chain_convert_impl::first_expr_l<Rng1,V>::type
- chain_convert_l(Rng1& r1,
+ chain_l(Rng1& r1,
         typename boost::enable_if<boost::is_same<R,use_default> >::type* = 0
     ){
         typedef detail::chain_convert_impl::first_expr_l<Rng1,V> caller_;
@@ -218,7 +226,7 @@
         Rng1,
         typename detail::chain_convert_impl::deduce_value<Rng1,false>::type
>::type
- chain_convert_l(Rng1& r1)
+ chain_l(Rng1& r1)
     {
         typedef typename detail::chain_convert_impl::deduce_value<
             Rng1,false
@@ -231,7 +239,7 @@
 
     template<typename V,typename R,typename Rng1>
     typename detail::chain_convert_impl::first_expr_r<Rng1,V,R>::type
- chain_convert_r(const Rng1& r1,
+ chain_r(const Rng1& r1,
         typename boost::disable_if<boost::is_same<R,use_default> >::type* = 0
     ){
         typedef detail::chain_convert_impl::first_expr_r<Rng1,V,R> caller_;
@@ -240,7 +248,7 @@
 
     template<typename V,typename R,typename Rng1>
     typename detail::chain_convert_impl::first_expr_r<Rng1,V>::type
- chain_convert_r(const Rng1& r1,
+ chain_r(const Rng1& r1,
         typename boost::enable_if<boost::is_same<R,use_default> >::type* = 0
     ){
         typedef detail::chain_convert_impl::first_expr_r<Rng1,V> caller_;
@@ -253,7 +261,7 @@
         typename detail::chain_convert_impl::deduce_value<
             const Rng1,true>::type
>::type
- chain_convert_r(const Rng1& r1)
+ chain_r(const Rng1& r1)
     {
         typedef typename detail::chain_convert_impl::deduce_value<
             const Rng1,true

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -12,7 +12,7 @@
 #include <boost/range/chain.hpp>
 
 namespace boost{
-namespace assign{
+namespace range{
 namespace detail{
 
 namespace result_of{
@@ -38,7 +38,7 @@
 }
 
 }// detail
-}// assign
+}// range
 }// boost
 
 #endif
\ No newline at end of file

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-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -64,7 +64,7 @@
         <li>Functions repeat(), repeat_fun() and
                                                                       <a href="#ref-repeat"><code>range()</code>
                                                                       </a></li>
- <li>Functions chain_convert_l() and chain_convert_r()</li>
+ <li>Functions chain_convert_l() and chain_convert_r()</li>
        <li>Customizing argument list sizes </li>
      </ul>
     <li>
@@ -74,6 +74,7 @@
         <li> Proxy object generic_list<> </li>
         <li> Proxy object list_inserter<></li>
         <li> Proxy object static_generic_list<> </li>
+ <li> Proxy object range_comparison_op::base_of<> </li>
         <li> Proxy object array_interface<> </li>
         <li> Proxy object chain_convert_impl::expr<> </li>
         <li> Proxy object expr<> </li>
@@ -1199,6 +1200,7 @@
         <li> Proxy object generic_list<> </li>
         <li> Proxy object list_inserter<></li>
         <li> Proxy object static_generic_list<> </li>
+ <li> Proxy object range_comparison_op::base_of<> </li>
         <li> Proxy object array_interface<> </li>
         <li> Proxy object expr<> </li>
         <li> Proxy object lazy_array<> </li>
@@ -1535,6 +1537,47 @@
   chain argument list together in a very space-efficient manner.
   </p>
 
+ <h4>Proxy object <code>range_comparison_op::base_of&lt;&gt;</code><a name="ref-range_comparison_op"></h4>
+ <b>Header</b> <code>&lt;boost/assign/auto_size/range_comparison_op/base_of.hpp></code>
+
+ <p>
+ <b>Template parameters</b>
+ </p>
+
+ <blockquote>
+ <table cellpadding=5 border=1>
+ <tr><th class="head">Parameter</th> <th class="head">Description</th>
+ <tr><td><tt>D</tt></td><td> Derived </td> </tr>
+ </table>
+ </blockquote>
+
+ <p>
+ <b>Requirements</b>
+ </p>
+
+ <blockquote>
+ <table cellpadding=5 border=1>
+ <tr><th class="head">Expression</th> <th class="head">Description</th>
+ <tr><td><tt>range_comparison_op::base_of&lt;D&gt;::type</tt></td><td>Public base of <tt>D</tt></td> </tr>
+ </table>
+ </blockquote>
+
+ <p>
+ <b>Properties</b>
+ </p>
+ Let <b>G</b> denote the set of types that meet the above requirement, and <tt>L</tt> and <tt>R</tt> models of SinglePassRange. For either of
+ (<tt>L</tt> xor <tt>R</tt>) or (<tt>L</tt> and <tt>R</tt>) in <b>G</b>, and <tt>l</tt> and <tt>r</tt> objects of type <tt>l</tt> and <tt>r</tt>,
+ respectively,
+ <blockquote>
+ <table cellpadding=5 border=1>
+ <tr><th class="head">Expression</th> <th class="head">Result</th>
+ <tr><td><tt>l == r</tt></td><td> boost::iterator_range_detail::equal( l, r ) </td> </tr>
+ <tr><td><tt>l != r</tt></td><td> boost::iterator_range_detail::less_than( l, r ) </td> </tr>
+ </table>
+ </blockquote>
+ The remaining operators, <tt>!=</tt>, <tt>></tt>, <tt><=</tt>, <tt>>=</tt> are defined using their logical relationships to the two fundamental ones above.
+
+
   <h4>Proxy object <code>array_interface&lt;&gt;</code><a name="ref-array_interface"></h4>
   <p>Exposes most of the <code>boost::array&lt;&gt;</code> interface.</p>
   <b>Header</b> <code>&lt;boost/assign/auto_size/array/interface.hpp></code>
@@ -1562,7 +1605,7 @@
           <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>converter<></td><td> Private base class of array_interface<></td> </tr>
- <tr><td><tt>range_comparison_op::base_of&lt&gt::type</tt></td><td> Public base class of array_interface<></td> </tr>
+ <tr><td>range_comparison_op::base_of<>::type</td><td> Public base class of array_interface<></td> </tr>
           </table>
   </blockquote>
 
@@ -1632,7 +1675,7 @@
         <span class="keyword">typedef</span> Implementation-defined result_type;
         <span class="keyword">explicit</span> expr(<span class="keyword">const</span> E& p,T& t);
         <span class="keyword">template</span>&lt;<span class="keyword">typename</span> E1,<span class="keyword">typename</span> P1,<span class="keyword">bool</span> F1>
- <span class="keyword">explicit</span> expr(<span class="keyword">const</span> expr<E1,T,N,R,P1,F1>& that);
+ <span class="keyword">explicit</span> expr(<span class="keyword">const</span> expr&lt;E1,T,N,R,P1&gt;& that);
 
         result_type <span class="keyword">operator</span>()(T& t)<span class="keyword">const</span>;
         

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-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -41,27 +41,26 @@
     BOOST_AUTO(tmp2,ref_list_of(c)(d));
     BOOST_AUTO(tmp3,ref_list_of(e)(f));
 
-/*
     os << " chain_l(tmp1)(tmp2)(tmp3) = (";
     boost::copy(
- chain_convert_l(tmp1)(ar5)(tmp3),
+ chain_l(tmp1)(ar5)(tmp3),
         std::ostream_iterator<val_>(os," ")
     );
     os << ") becomes (";
     boost::copy(
- chain_convert_l(ar1)(ar2)(ar3),
- boost::begin(chain_convert_l(tmp1)(ar5)(tmp3))
+ chain_l(ar1)(ar2)(ar3),
+ boost::begin(chain_l(tmp1)(ar5)(tmp3))
     );
     boost::copy(
- chain_convert_l(tmp1)(ar5)(tmp3),
+ chain_l(tmp1)(ar5)(tmp3),
         std::ostream_iterator<val_>(os," ")
     );
     os << ") should equal (";
     boost::copy(
- chain_convert_l(ar1)(ar2)(ar3),
+ chain_l(ar1)(ar2)(ar3),
         std::ostream_iterator<val_>(os," ")
     ); os << ')' << std::endl;
-*/
+
 }
         os << "<- " << std::endl;
     

Modified: sandbox/statistics/detail/assign/libs/assign/src/main.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/src/main.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/src/main.cpp 2010-03-25 21:55:40 EDT (Thu, 25 Mar 2010)
@@ -1,25 +1,25 @@
 #include <iostream>
 #define BOOST_ASSIGN_CHECK_EQUAL(a,b) BOOST_ASSERT(a==b)
-#include <boost/assign/auto_size/check/ref_list_of.hpp>
+//#include <boost/assign/auto_size/check/ref_list_of.hpp>
 //#include <boost/assign/auto_size/check/ref_csv.hpp>
 #undef BOOST_ASSIGN_CHECK_EQUAL
 #include <libs/assign/example/range.h>
 
 int main (int argc, char * const argv[]) {
 
- using namespace boost::assign::detail::auto_size;
+ //using namespace boost::assign::detail::auto_size;
 
- void (*fp)();
+ //void (*fp)();
     
- fp = check_ref_list_of_example1<int>;
+ //fp = check_ref_list_of_example1<int>;
 
- (*fp)();
+ //(*fp)();
 
- std::cout << "check_ref_list_of : ok" << std::endl;
- //check_ref_csv_int();
- //std::cout << "check_csv : ok" << std::endl;
+ //std::cout << "check_ref_list_of : ok" << std::endl;
+ //check_ref_csv_int();
+ //std::cout << "check_csv : ok" << std::endl;
 
- example_range(std::cout);
+ example_range(std::cout);
 
     return 0;
 


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