Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71791 - in sandbox/assign_v2: boost/assign/v2/interpreter boost/assign/v2/put libs/assign/v2/speed libs/assign/v2/test/ref
From: erwann.rogard_at_[hidden]
Date: 2011-05-07 17:21:59


Author: e_r
Date: 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
New Revision: 71791
URL: http://svn.boost.org/trac/boost/changeset/71791

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/interpreter/as_arg_list.hpp | 23 ++++++++++++++++++-----
   sandbox/assign_v2/boost/assign/v2/interpreter/csv.hpp | 29 ++++++++++++++++++++---------
   sandbox/assign_v2/boost/assign/v2/put/csv_put.hpp | 2 +-
   sandbox/assign_v2/boost/assign/v2/put/delay_csv_put.hpp | 28 +++++++++++++++++++---------
   sandbox/assign_v2/libs/assign/v2/speed/test.cpp | 2 +-
   sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp | 2 +-
   6 files changed, 60 insertions(+), 26 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/interpreter/as_arg_list.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/interpreter/as_arg_list.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/interpreter/as_arg_list.hpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -12,26 +12,27 @@
 #include <boost/assign/v2/support/pp/ignore.hpp>
 #include <boost/range/iterator.hpp>
 #include <boost/range/iterator_range.hpp>
+#include <boost/mpl/bool.hpp>
 
 namespace boost{
 namespace assign{
 namespace v2{
 //[syntax_interpreter_as_arg_list
-namespace interpreter_aux{
+namespace interpreter_aux{
 
     template<
         typename R // Range
>
- struct as_arg_list_adapter
+ struct as_arg_list_adapter
         : boost::iterator_range<
             typename boost::range_iterator<R>::type
>/*<-*/
     {
-
+
         typedef boost::iterator_range<
             typename boost::range_iterator<R>::type
> super_t;
-
+
         public:
 
         as_arg_list_adapter(R& range)
@@ -44,6 +45,18 @@
         as_arg_list_adapter();
     }/*->*/;
 
+ template<typename T>
+ struct is_as_arg_list_adapter
+ : ::boost::mpl::false_
+ {};
+
+ template<typename R>
+ struct is_as_arg_list_adapter<
+ as_arg_list_adapter<R>
+ >
+ : ::boost::mpl::true_
+ {};
+
 namespace result_of{
 
     template<typename R>
@@ -72,7 +85,7 @@
 
     using interpreter_aux::as_arg_list;
 
-namespace result_of{
+namespace result_of{
     using interpreter_aux::result_of::as_arg_list;
 }// result_of
 

Modified: sandbox/assign_v2/boost/assign/v2/interpreter/csv.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/interpreter/csv.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/interpreter/csv.hpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -13,6 +13,9 @@
 #include <boost/assign/v2/interpreter/as_arg_list.hpp>
 #include <boost/assign/v2/support/config/enable_cpp0x.hpp>
 #include <boost/assign/v2/support/pp/ignore.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 #if BOOST_ASSIGN_V2_ENABLE_CPP0X
 #include <utility>
 
@@ -30,38 +33,46 @@
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
 
     template<
- typename D, typename C, typename F, typename MTag, typename DTag,
+ typename D, typename C, typename F, typename MTag, typename DTag,
         typename R
>
     void invoke(
         interpreter_crtp<D, C, F, MTag, DTag> const& interpreter,
- as_arg_list_adapter<R>&& adapter
+ const as_arg_list_adapter<R>& adapter
     )/*<-*/
     {
- interpreter.as_arg_list( std::forward<T>( adapter ) );
+ interpreter.as_arg_list( adapter );
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
 
     template<
- typename D, typename C, typename F, typename MTag, typename DTag,
+ typename D, typename C, typename F, typename MTag, typename DTag,
         typename T
>
- void invoke(
+ typename boost::disable_if<
+ is_as_arg_list_adapter<
+ typename boost::remove_cv<
+ typename boost::remove_reference<T>::type
+ >::type
+ >
+ >::type
+ invoke(
         interpreter_crtp<D, C, F, MTag, DTag> const& interpreter,
         T&& t
     )/*<-*/
     {
         interpreter( std::forward<T>( t ) );
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
-
- template<typename D, typename C, typename F, typename MTag, typename DTag,
+
+ template<typename D, typename C, typename F, typename MTag, typename DTag,
         typename T, typename... Args>
     void csv(
         interpreter_crtp<D, C, F, MTag, DTag> const& interpreter,
         T&& t, Args&&... args
     )/*<-*/
     {
- return csv(
- invoke( interpreter, t ),
+ invoke( interpreter, t );
+ csv(
+ interpreter,
             std::forward<Args>( args )...
         );
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/

Modified: sandbox/assign_v2/boost/assign/v2/put/csv_put.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/csv_put.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/csv_put.hpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -113,7 +113,7 @@
             make_csv_ready(
                 put( cont ) % option
             ),
- std::forward<Args>( args )...
+ std::forward<Args>( args )...
         );
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
 

Modified: sandbox/assign_v2/boost/assign/v2/put/delay_csv_put.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/delay_csv_put.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/delay_csv_put.hpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -27,25 +27,35 @@
 
     template<typename R, typename O = empty_list_option>
     struct delayed_csv_put/*<-*/
- : O, as_arg_list_adapter<R>
     {
 
- typedef O super1_t;
- typedef as_arg_list_adapter<R> super2_t;
-
- super1_t const& options()const{ return (*this); }
- super2_t const& arg_list()const{ return (*this); }
+ O const& options()const{ return this->options_; }
+ as_arg_list_adapter<R> const& arg_list()const
+ {
+ return this->arg_list_;
+ }
 
         explicit delayed_csv_put(R& r)
- : super2_t( r )
+ : arg_list_( r )
         {}
 
         delayed_csv_put(O options, R& r)
- : super1_t( options ), super2_t( r )
+ : options_( options ), arg_list_( r )
         {}
 
+ private:
+ O options_;
+ as_arg_list_adapter<R> arg_list_;
+
     }/*->*/;
 
+ template<typename C, typename R>
+ C& operator|(C& cont, delayed_csv_put<R> const& rhs)/*<-*/
+ {
+ csv_put( cont, rhs.arg_list() );
+ return cont;
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
     template<typename C, typename R, typename O>
     C& operator|(C& cont, delayed_csv_put<R, O> const& rhs)/*<-*/
     {
@@ -53,7 +63,7 @@
         return cont;
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
 
-namespace result_of{
+namespace result_of{
 
     template<typename R, typename O = empty_list_option>
     struct delay_csv_put/*<-*/

Modified: sandbox/assign_v2/libs/assign/v2/speed/test.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/speed/test.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/speed/test.cpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -313,7 +313,7 @@
         methods.push_back( "v2_ref_array" );
         methods.push_back( "v2_ref_csv_array" );
 
- for(int i = 0; i!= methods.size(); i++ )
+ for(std::size_t i = 0; i!= methods.size(); i++ )
         {
             str_ method = methods[i];
             os << ( f % method % cols[ method ] ).str();

Modified: sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp 2011-05-07 17:21:58 EDT (Sat, 07 May 2011)
@@ -64,7 +64,7 @@
             //]
             {
                 T& a = ( *boost::begin( ar4 ) );
- T& b = *boost::next(boost::begin( ar4 ), ar4.size() - 1 );
+ T& b = *boost::next( boost::begin( ar4 ), ar4.size() - 1 );
 
                 BOOST_ASSIGN_V2_CHECK( &a == &w );
                 BOOST_ASSIGN_V2_CHECK( &b == &z );


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