Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71051 - in sandbox/assign_v2/boost/assign/v2: put put/cpp03 ref ref/array
From: erwann.rogard_at_[hidden]
Date: 2011-04-06 17:46:23


Author: e_r
Date: 2011-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
New Revision: 71051
URL: http://svn.boost.org/trac/boost/changeset/71051

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/put/cpp03/delay_csv_put.hpp | 87 +++++++++++++++-
   sandbox/assign_v2/boost/assign/v2/put/delay_csv_put.hpp | 206 ++++++++-------------------------------
   sandbox/assign_v2/boost/assign/v2/put/put.hpp | 2
   sandbox/assign_v2/boost/assign/v2/ref/array.hpp | 1
   sandbox/assign_v2/boost/assign/v2/ref/array/as_arg_list.hpp | 55 ----------
   5 files changed, 125 insertions(+), 226 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/put/cpp03/delay_csv_put.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/cpp03/delay_csv_put.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/cpp03/delay_csv_put.hpp 2011-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
@@ -1,9 +1,80 @@
-/*
- * delayed_csv_put.hpp
- * as2
- *
- * Created by erwann on 4/6/11.
- * Copyright 2011 __MyCompanyName__. All rights reserved.
- *
- */
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_V2_PUT_CPP03_DELAY_CSV_PUT_HPP_ER_2010
+#define BOOST_ASSIGN_V2_PUT_CPP03_DELAY_CSV_PUT_HPP_ER_2010
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+//[syntax_delay_csv_put
+namespace interpreter_aux{
+
+ template<typename U>
+ typename result_of::delay_csv_put<U, 0>::type
+ delay_csv_put()
+ {
+ return typename result_of::delay_csv_put<U, 0>::type(
+ ref::csv_array<U>();
+ );
+ }
+
+#define BOOST_ASSIGN_V2_MACRO2(z, N, U)\
+ template<typename T, arg_list_size_type N>\
+ typename result_of::delay_csv_put<U, N>::type\
+ delay_csv_put( BOOST_PP_ENUM_PARAMS(N, U &_) )\
+ {\
+ return typename result_of::delay_csv_put<U, N>::type(\
+ ref::csv_array<U>( BOOST_PP_ENUM_PARAMS(N, _) )\
+ );\
+ }\
+ template<typename T, typename O, bool is, arg_list_size_type N>\
+ typename result_of::delay_csv_put<U, N>::type\
+ delay_csv_put(\
+ option_crtp<O, is> const& crtp,\
+ BOOST_PP_ENUM_PARAMS(N, U &_)\
+ )\
+ {\
+ typedef O const& options_;\
+ options_ options = static_cast<options_>( crtp );\
+ return typename result_of::delay_csv_put<U, N>::type(\
+ ref::csv_array<U>( BOOST_PP_ENUM_PARAMS(N, _) )\
+ );\
+ }\
+/**/
+
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
+ BOOST_ASSIGN_V2_MACRO2,
+ T
+)
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
+ BOOST_ASSIGN_V2_MACRO2,
+ T const
+)
+#undef BOOST_ASSIGN_V2_MACRO1
+#undef BOOST_ASSIGN_V2_MACRO2
+
+}// interpreter_aux
+
+ using interpreter_aux::delay_csv_put;
+
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_CPP03_DELAY_CSV_PUT_HPP_ER_2010
 

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-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
@@ -10,193 +10,75 @@
 #ifndef BOOST_ASSIGN_V2_PUT_DELAYED_CSV_PUT_HPP_ER_2010
 #define BOOST_ASSIGN_V2_PUT_DELAYED_CSV_PUT_HPP_ER_2010
 #include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
-#include <boost/assign/v2/detail/keyword.hpp>
-#include <boost/assign/v2/detail/traits.hpp>
+#include <boost/assign/v2/detail/pp/ignore.hpp>
 #include <boost/assign/v2/put/put.hpp>
 #include <boost/assign/v2/option/list.hpp>
-#include <boost/assign/v2/ref/array/as_arg_list.hpp>
-#include <boost/assign/v2/ref/array/csv_array.hpp>
-#include <boost/assign/v2/ref/wrapper/copy.hpp>
-#include <boost/mpl/apply.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/size.hpp>
-#include <boost/mpl/vector/vector0.hpp>
-#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
-#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
-#include <boost/assign/v2/ref/wrapper/cpp0x.hpp>
-#include <boost/mpl/aux_/na.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/repetition.hpp>
-#endif
+#include <boost/assign/v2/ref/array/as_arg_list.hpp>
+#include <boost/call_traits.hpp>
+#include <boost/concept_check.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
 
 namespace boost{
     struct use_default;
 namespace assign{
 namespace v2{
-//[syntax_pipe_csv_put
+//[syntax_delay_csv_put
 namespace interpreter_aux{
 
- typedef ref::array_aux::size_type arg_list_size_type;
+ template<typename R, typename Os = empty_list_option>
+ struct delayed_csv_put/*<-*/
+ : as_arg_list_adapter<
+ typename boost::add_const<R>::type
+ >,
+ Os
+ {
+ typedef as_arg_list_adapter<
+ typename boost::add_const<R>::type
+ > super1_t;
 
- template<arg_list_size_type N, typename U, typename Os = empty_list_option>
- struct delayed_csv_put_holder/*<-*/
- {
- typedef typename v2::ref::nth_result_of::csv_array<
- N, U
- >::type arg_list_type; //notice it's arg, not args
-
- delayed_csv_put_holder(){}
- delayed_csv_put_holder(arg_list_type const& a)
- : arg_list_( a )
+ typedef Os super2_t;
+
+ explicit delayed_csv_put(typename call_traits<R>::param_type r)
+ : super1_t( r )
         {}
- delayed_csv_put_holder(Os options, arg_list_type const& a)
- : options_( options ), arg_list_( a )
+
+ explicit delayed_csv_put(
+ Os options,
+ typename call_traits<R>::param_type r
+ )
+ : super1_t( r ), super2_t( options )
         {}
 
- arg_list_type const& arg_list() const
+ template<typename C>
+ C& apply(C& cont)
         {
- return this->arg_list_cont_;
- }
 
- Os const& options() const
- {
- return this->options_;
+ make_csv_ready(
+ put( cont ) % static_cast<super2_t const&>( *this )
+ )(
+ static_cast<super1_t const&>( *this )
+ );
+
+ return cont;
+
         }
 
- protected:
- Os options_;
- arg_list_type arg_list_;
-
- }/*->*/;
-
-#if BOOST_ASSIGN_V2_ENABLE_CPP0X
-
-namespace result_of{
-
- template<arg_list_size_type N, typename U, typename Os = empty_list_option>
- struct delayed_csv_put
- {
- typedef delayed_csv_put_holder<
- typename ref::wrapper_param<U>::type, N, Os
- > type;
- };
-
-}// result_of
-
- // Explicit U
-
- template<typename U, typename...Args>
- typename result_of::delayed_csv_put<U, size_of...(Args)>::type
- delayed_csv_put(Args&&... args)
- {
- return typename result_of::delayed_csv_put<U, size_of...(Args)>::type(
- ref::csv_array<U>( std::forward<Args>( args )... )
- );
- }
-
- template<typename U, typename O, bool is, typename...Args>
- typename result_of::delayed_csv_put<U, size_of...(Args), O>::type
- delayed_csv_put(option_crtp<O, is> const& crtp, Args&&... args)
- {
- typedef O const& options_;
- options_ options = static_cast<options_>( crtp );
- return typename result_of::delayed_csv_put<
- U, size_of...(Args), O
- >::type(
- options,
- ref::csv_array<U>( std::forward<Args>( args )... )
- );
- }
-
- // Implicit U
-
- template<typename U, typename...Args>
- typename result_of::delayed_csv_put<U, 1 + size_of...(Args)>::type
- delayed_csv_put(U&& u, Args&&... args)
- {
- return delayed_csv_put<U>(
- std::forward<U>( u ),
- std::forward<Args>( args ) ...
- );
- }
-
- template<typename U, typename O, bool is, typename...Args>
- typename result_of::delayed_csv_put<U, 1 + size_of...(Args), O>::type
- delayed_csv_put(option_crtp<O, is> const& crtp, U&& u, Args&&... args)
- {
- return delayed_csv_put<U>(
- crtp,
- std::forward<U>( u ),
- std::forward<Args>( args ) ...
- );
- }
-
-#else
-
- template<typename U>
- typename result_of::delayed_csv_put<U, 0>::type
- delayed_csv_put()
- {
- return typename result_of::delayed_csv_put<U, 0>::type(
- ref::csv_array<U>();
- );
- }
-
-#define BOOST_ASSIGN_V2_MACRO2(z, N, U)\
- template<typename T, arg_list_size_type N>\
- typename result_of::delayed_csv_put<U, N>::type\
- delayed_csv_put( BOOST_PP_ENUM_PARAMS(N, U &_) )\
- {\
- return typename result_of::delayed_csv_put<U, N>::type(\
- ref::csv_array<U>( BOOST_PP_ENUM_PARAMS(N, _) )\
- );\
- }\
- template<typename T, typename O, bool is, arg_list_size_type N>\
- typename result_of::delayed_csv_put<U, N>::type\
- delayed_csv_put(\
- option_crtp<O, is> const& crtp,\
- BOOST_PP_ENUM_PARAMS(N, U &_)\
- )\
- {\
- typedef O const& options_;\
- options_ options = static_cast<options_>( crtp );\
- return typename result_of::delayed_csv_put<U, N>::type(\
- ref::csv_array<U>( BOOST_PP_ENUM_PARAMS(N, _) )\
- );\
- }\
-/**/
-
-BOOST_PP_REPEAT_FROM_TO(
- 1,
- BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
- BOOST_ASSIGN_V2_MACRO2,
- T
-)
-BOOST_PP_REPEAT_FROM_TO(
- 1,
- BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
- BOOST_ASSIGN_V2_MACRO2,
- T const
-)
-#undef BOOST_ASSIGN_V2_MACRO1
-#undef BOOST_ASSIGN_V2_MACRO2
-
-#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
 
     }/*->*/;
 
- template<typename C, arg_list_size_type N, typename U, typename Os>
- C& operator|(C& cont, delayed_csv_put_holder<N, U, Os> const& rhs)/*<-*/
+ template<typename C, typename R, typename Os>
+ C& operator|(C& cont, delayed_csv_put<R, O> const& rhs)/*<-*/
     {
- v2::ref::as_arg_list(
- make_csv_ready( put( cont ) % rhs.options() ),
- rhs.arg_list()
- );
- return cont;
+ return rhs.apply( cont )
 
     }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
 
 }// interpreter_aux
+
+ using interpreter_aux::delay_csv_put;
+
 //]
 }// v2
 }// assign

Modified: sandbox/assign_v2/boost/assign/v2/put/put.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/put.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/put.hpp 2011-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
@@ -19,7 +19,7 @@
 namespace boost{
 namespace assign{
 namespace v2{
-//[syntax_put_put
+//[syntax_put
 namespace interpreter_aux{
 
     template<typename C, typename F, typename MTag, typename DTag>

Modified: sandbox/assign_v2/boost/assign/v2/ref/array.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/array.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/array.hpp 2011-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
@@ -9,7 +9,6 @@
 //////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_ASSIGN_V2_REF_ARRAY_ER_2010_HPP
 #define BOOST_ASSIGN_V2_REF_ARRAY_ER_2010_HPP
-#include <boost/assign/v2/ref/array/as_arg_list.hpp>
 #include <boost/assign/v2/ref/array/conversion.hpp>
 #include <boost/assign/v2/ref/array/array.hpp>
 #include <boost/assign/v2/ref/array/csv_array.hpp>

Modified: sandbox/assign_v2/boost/assign/v2/ref/array/as_arg_list.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/array/as_arg_list.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/array/as_arg_list.hpp 2011-04-06 17:46:22 EDT (Wed, 06 Apr 2011)
@@ -1,54 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_ASSIGN_V2_REF_ARRAY_AS_ARG_LIST_ER_2010_HPP
-#define BOOST_ASSIGN_V2_REF_ARRAY_AS_ARG_LIST_ER_2010_HPP
-#include <boost/assign/v2/ref/array/interface.hpp>
-#include <boost/assign/v2/ref/array/size_type.hpp>
-#include <boost/utility/enable_if.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace ref{
-namespace array_aux{
-
- // --- Implementation --- //
-
- template<size_type I, typename F, typename Impl, typename D>
- typename boost::enable_if_c<
- D::static_size == I
- >::type
- as_arg_list( F const& f, interface<Impl, D> const& array)
- {}
-
- template<size_type I, typename F, typename Impl, typename D>
- typename boost::enable_if_c< I < D::static_size >::type
- as_arg_list(F const& f , interface<Impl, D> const& array)
- {
- f( array[ I ].get() );
- as_arg_list<I + 1>( f, array );
- }
-
- // --- User interface --- //
-
- template<typename F, typename Impl, typename D>
- void as_arg_list(F const& f , interface<Impl, D> const& array)
- {
- as_arg_list<0>( f, array );
- }
-
-}// array_aux
-using array_aux::as_arg_list;
-}// ref
-}// v2
-}// assign
-}// boost
-
-#endif // BOOST_ASSIGN_V2_REF_ARRAY_AS_ARG_LIST_ER_2010_HPP
+// TODO remove file
\ No newline at end of file


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