Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60862 - in sandbox/statistics/detail/assign: boost/assign/auto_size/range libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-26 11:03:21


Author: e_r
Date: 2010-03-26 11:03:19 EDT (Fri, 26 Mar 2010)
New Revision: 60862
URL: http://svn.boost.org/trac/boost/changeset/60862

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp | 24 ++++++++----------------
   sandbox/statistics/detail/assign/libs/assign/example/range.cpp | 8 +++++++-
   2 files changed, 15 insertions(+), 17 deletions(-)

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-26 11:03:19 EDT (Fri, 26 Mar 2010)
@@ -23,6 +23,7 @@
 #include <boost/assign/auto_size/range/hold_previous.hpp>
 #include <boost/assign/auto_size/range/hold_converted_range.hpp>
 #include <boost/assign/auto_size/range/basic_chain.hpp>
+#include <boost/assign/auto_size/range/converter.hpp>
 
 #include <boost/mpl/assert.hpp> // tmp
 #include <boost/type_traits/is_reference.hpp> // tmp
@@ -94,6 +95,9 @@
     {
         typedef expr<L,E,Rng1,is_first,V,R,add_const> this_;
 
+ template<typename R2,bool b>
+ struct enable : boost::enable_if_c<b>{};
+
         public:
         
         // bases
@@ -127,11 +131,7 @@
         template<typename Rng2>
         struct result_impl
             { typedef expr<list_,impl_,Rng2,false,V,R,add_const> type; };
-
- template<typename R2,bool b>
- struct enable : boost::enable_if_c<b>{};
-
-
+
         template<typename Rng2> // Warning : overrides base.
         typename result_impl<Rng2>::type
         operator()(Rng2& r2,typename enable<Rng2,!add_const>::type* = 0)
@@ -156,18 +156,10 @@
             );
         }
 
- // conversion
-
- // TODO implement all conversion capabilities. It might be better to
- // put the code in assign_detail::converter into a macro and expand it
- // here (valid also for array_interface).
+ // This macro solves compiler complaints that otherwise occurr if
+ // assign_detail::converter<> is a base
+ BOOST_ASSIGN_AS_CONVERTER
         
- template< class Container >
- operator Container() const
- {
- return Container(boost::begin(*this),boost::end(*this));
- }
-
     };
 
     // ---- traits ---- //

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-26 11:03:19 EDT (Fri, 26 Mar 2010)
@@ -41,6 +41,12 @@
     BOOST_AUTO(tmp2,ref_list_of(c)(d));
     BOOST_AUTO(tmp3,ref_list_of(e)(f));
 
+ std::vector<val_> v = tmp1.converter;
+ boost::copy(
+ v,
+ std::ostream_iterator<val_>(os," "));
+
+/*
     os << " chain_l(tmp1)(tmp2)(tmp3) = (";
     boost::copy(
         chain_l(tmp1)(ar5)(tmp3),
@@ -60,7 +66,7 @@
         chain_l(ar1)(ar2)(ar3),
         std::ostream_iterator<val_>(os," ")
     ); os << ')' << std::endl;
-
+*/
 }
         os << "<- " << std::endl;
     


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