Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60187 - in sandbox/statistics/detail/assign/boost/assign/auto_size: array detail
From: erwann.rogard_at_[hidden]
Date: 2010-03-05 09:25:24


Author: e_r
Date: 2010-03-05 09:25:23 EST (Fri, 05 Mar 2010)
New Revision: 60187
URL: http://svn.boost.org/trac/boost/changeset/60187

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp | 5 +++++
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp | 26 ++++++++++++++++++++++++--
   2 files changed, 29 insertions(+), 2 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp 2010-03-05 09:25:23 EST (Fri, 05 Mar 2010)
@@ -32,6 +32,9 @@
         typedef typename Ref<T>::type ref_;
         typedef typename ref_array<T,N,Ref>::type ref_array_;
 
+
+ // ---- boost::array ---- //
+
         typedef ref_ value_type;
         typedef typename
                 boost::range_iterator<ref_array_>::type iterator;
@@ -88,6 +91,8 @@
             return this->assign(val,pred_());
         }
 
+ // ---- Conversion ---- //
+
         template<typename T1>
         operator boost::array<T1,N>()const{
             boost::array<T1,N> ar;

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-05 09:25:23 EST (Fri, 05 Mar 2010)
@@ -79,14 +79,36 @@
         typedef typename next<expr>::type result_type;
 
         expr(const E& p,T& t):previous(p),ref(t){}
- result_type operator()(T& t)const{ return result_type(*this,t); }
-
         template<typename E1>
         expr(const E1& that)
             :super_(that)
             ,previous(that.previous)
             ,ref(that.ref){}
 
+ result_type operator()(T& t)const{ return result_type(*this,t); }
+
+ template< class ForwardIterator >
+ expr& range( ForwardIterator first,
+ ForwardIterator last )
+ {
+ for( ; first != last; ++first )
+ (*this)( *first );
+ return *this;
+ }
+
+ template< class ForwardRange >
+ expr& range( ForwardRange& r )
+ {
+ return this->range( boost::begin(r), boost::end(r) );
+ }
+
+ template< class ForwardRange >
+ expr& range( const ForwardRange& r )
+ {
+ return this->range( boost::begin(r), boost::end(r) );
+ }
+
+
 
         mutable previous_ previous;
         mutable ref_ ref;


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