Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60729 - in sandbox/statistics/detail/assign/boost/assign/auto_size: array check reference_wrapper
From: erwann.rogard_at_[hidden]
Date: 2010-03-19 22:30:07


Author: e_r
Date: 2010-03-19 22:30:06 EDT (Fri, 19 Mar 2010)
New Revision: 60729
URL: http://svn.boost.org/trac/boost/changeset/60729

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp | 21 +++++++++++++++++++--
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp | 20 ++++++++++++--------
   sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/copy.hpp | 3 ++-
   3 files changed, 33 insertions(+), 11 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-19 22:30:06 EDT (Fri, 19 Mar 2010)
@@ -10,6 +10,7 @@
 #define BOOST_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_INTERFACE_ER_2010_HPP
 #include <algorithm>
 #include <boost/mpl/bool.hpp>
+#include <boost/mpl/int.hpp>
 #include <boost/array.hpp>
 #include <boost/range.hpp>
 #include <boost/assign/auto_size/array/converter.hpp>
@@ -87,8 +88,13 @@
         const_reference back() const{ return (this->ref_array()).back(); }
         
         void swap(array_interface& other){
- (this->ref_array()).swap(other.ref_array());
+ // Before March 19th :
+ //(this->ref_array()).swap(other.ref_array());
+ // does not swap anything under Mingw, hence the change below:
+ typedef boost::mpl::int_<N> int_n_;
+ this->swap_impl(other,int_n_());
         }
+
         void assign(const T& val){
             typedef has_copy_semantics<ref_> pred_;
             return this->assign(val,pred_());
@@ -102,10 +108,21 @@
         }
 
         private:
-
         typedef boost::mpl::bool_<false> false_;
         typedef boost::mpl::bool_<true> true_;
 
+ void swap_impl(array_interface& other,boost::mpl::int_<0>){}
+
+ template<int N1>
+ void swap_impl(array_interface& other,boost::mpl::int_<N1>){
+ reference lhs = (*this)[N1-1];
+ reference rhs = (other)[N1-1];
+ lhs.swap(rhs); //TODO should be able to call swap(lhs,rhs)
+ typedef boost::mpl::int_<N1-1> next_int_;
+ this->swap_impl(other,next_int_());
+ }
+
+
         void assign(const T& val,true_ /*copy semantics*/){
             // Force copy semantics. Suggested by M.P.G on Feb 28th, 2010.
             ref_array_& ra = this->ref_array();

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp 2010-03-19 22:30:06 EDT (Fri, 19 Mar 2010)
@@ -39,11 +39,21 @@
                                                                                \
 template<typename T> \
 void fun(){ \
+ BOOST_ASSIGN_AS_CHECK_copy_array \
+} \
+void BOOST_PP_CAT(fun,_int)(){ fun<int>(); } \
+} \
+} \
+} \
+} \
+/**/
+
+/*
     BOOST_ASSIGN_AS_CHECK_example1 \
     BOOST_ASSIGN_AS_CHECK_iterator \
     BOOST_ASSIGN_AS_CHECK_array \
     BOOST_ASSIGN_AS_CHECK_copy_iterator \
- BOOST_ASSIGN_AS_CHECK_copy_array \
+
     BOOST_ASSIGN_AS_CHECK_rebind_array \
     BOOST_ASSIGN_AS_CHECK_converter(std::list<T>) \
     BOOST_ASSIGN_AS_CHECK_converter(std::vector<T>) \
@@ -55,13 +65,7 @@
     BOOST_ASSIGN_AS_CHECK_comparison_op \
     BOOST_ASSIGN_AS_CHECK_example2 \
     BOOST_ASSIGN_AS_CHECK_chain \
-} \
-void BOOST_PP_CAT(fun,_int)(){ fun<int>(); } \
-} \
-} \
-} \
-} \
-/**/
+*/
 
 #endif
 

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/copy.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/copy.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/reference_wrapper/copy.hpp 2010-03-19 22:30:06 EDT (Fri, 19 Mar 2010)
@@ -8,7 +8,7 @@
 //////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_ASSIGN_DETAIL_ASSIGN_REFERENCE_COPY_MPG_2010_HPP
 #define BOOST_ASSIGN_DETAIL_ASSIGN_REFERENCE_COPY_MPG_2010_HPP
-
+#include <iostream> // tmp
 namespace boost{
 namespace assign{
 namespace detail{
@@ -40,6 +40,7 @@
 
         void swap( assign_reference_copy& r )
         {
+ std::cout << "copy::swap" << std::endl;
             std::swap( *this->ref_, *r.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