Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60867 - in sandbox/statistics/detail/assign: boost/assign/auto_size/detail boost/assign/auto_size/reference_wrapper libs/assign/doc
From: erwann.rogard_at_[hidden]
Date: 2010-03-26 15:01:26


Author: e_r
Date: 2010-03-26 15:01:23 EDT (Fri, 26 Mar 2010)
New Revision: 60867
URL: http://svn.boost.org/trac/boost/changeset/60867

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp | 4 ++--
   sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/rebind.hpp | 14 ++++++++++----
   sandbox/statistics/detail/assign/libs/assign/doc/revision_history.txt | 5 +++++
   3 files changed, 17 insertions(+), 6 deletions(-)

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-26 15:01:23 EDT (Fri, 26 Mar 2010)
@@ -142,14 +142,14 @@
     template<int Nshift,typename A,typename E,typename T,int N,
             template<typename> class R,typename P>
     void write_to_array(A& a,const expr<E,T,N,R,P>& e,false_ /*exit*/){
- a[Nshift+N-1] = e.ref;
+ a[Nshift+N-1].rebind( e.ref.get_ref() ) ;
         write_to_array<Nshift>(a,e.previous.get_ref());
     }
             
     template<int Nshift,typename A,typename E,typename T,int N,
             template<typename> class R,typename P>
     void write_to_array(A& a,const expr<E,T,N,R,P>& e,true_ /*exit*/){
- a[Nshift+N-1] = e.ref;
+ a[Nshift+N-1].rebind( e.ref.get_ref() ) ;
     }
 
     template<int Nshift,typename A,typename E,typename T,int N,

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/rebind.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/rebind.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/rebind.hpp 2010-03-26 15:01:23 EDT (Fri, 26 Mar 2010)
@@ -24,9 +24,9 @@
         assign_reference_rebind( T& r ) : ref_(&r)
         { }
 
- void operator=( T& r ) // should it return itself?
+ void operator=( T& r )
         {
- this->ref_ = &r;
+ this->rebind(r);
         }
 
         operator T&() const
@@ -37,8 +37,8 @@
         void swap( assign_reference_rebind& r )
         {
             T* tmp = this->ref_;
- this->ref_ = r.ref_;
- r.ref_ = tmp;
+ this->ref_ = r.ref_; // this->rebing(r.ref_)
+ r.ref_ = tmp; // r.rebind(tmp)
         }
 
         T& get_ref() const
@@ -46,6 +46,12 @@
             return *this->ref_;
         }
         
+ void rebind( T & r )
+ {
+ this->ref_ = &r;
+ }
+
+
     private:
         T* ref_;
 

Modified: sandbox/statistics/detail/assign/libs/assign/doc/revision_history.txt
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/doc/revision_history.txt (original)
+++ sandbox/statistics/detail/assign/libs/assign/doc/revision_history.txt 2010-03-26 15:01:23 EDT (Fri, 26 Mar 2010)
@@ -1,5 +1,10 @@
 // Revision history:
 //
+// March 25, 2010
+// in write_to_array, replaced
+// a[Nshift+N-1] = e.ref;
+// by the more explicit statement
+// a[Nshift+N-1].rebind( e.ref.get_ref() );
 // March 24, 2010 : Rename chain basic_chain. chain uses basic chain as
 // interface but passes to it a converted to range.
 // March 21, 2010 : Removed /chain. Added /traits and /range. Implem of


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