$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r69792 - sandbox/assign_v2/boost/assign/v2/put/pipe
From: erwann.rogard_at_[hidden]
Date: 2011-03-09 16:15:51
Author: e_r
Date: 2011-03-09 16:15:49 EST (Wed, 09 Mar 2011)
New Revision: 69792
URL: http://svn.boost.org/trac/boost/changeset/69792
Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/pipe/arg_list.hpp   (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/pipe/args_list.hpp   (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/pipe/csv_put.hpp   (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/pipe/put.hpp   (contents, props changed)
Added: sandbox/assign_v2/boost/assign/v2/put/pipe/arg_list.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/pipe/arg_list.hpp	2011-03-09 16:15:49 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,205 @@
+//////////////////////////////////////////////////////////////////////////////
+//  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_PIPE_ARG_LIST_HPP_ER_2010
+#define BOOST_ASSIGN_V2_PUT_PIPE_ARG_LIST_HPP_ER_2010
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/ref/array/csv_array.hpp>
+#include <boost/assign/v2/ref/wrapper/copy.hpp>
+#include <boost/assign/v2/put/pipe/csv/arg_list.hpp>
+#include <boost/assign/v2/put/pipe/modulo_traits.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/vector/vector0.hpp>
+#include <boost/mpl/size.hpp>
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+#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>
+#endif
+
+namespace boost{
+    struct use_default;
+namespace assign{
+namespace v2{
+namespace put_pipe_aux{
+
+	typedef ref::array_aux::size_type arg_list_size_type;
+
+    template<typename Pars, arg_list_size_type N, typename U>
+    struct arg_list
+    {
+        typedef boost::use_default tag2_;
+        typedef modulo_traits<Pars> modulo_traits_;
+        typedef typename modulo_traits_::cont_ par_list_cont_type;
+        typedef typename v2::ref::nth_result_of::csv_array<
+            N,
+            U
+        >::type arg_list_cont_type; //notice it's arg, not args
+
+        arg_list(){}
+        arg_list(par_list_cont_type const& a, arg_list_cont_type const& b)
+            : par_list_cont_( a ), arg_list_cont_( b ){}
+
+        par_list_cont_type const& par_list_cont()const 
+        {
+            return this->par_list_cont_;
+        }
+
+        arg_list_cont_type& arg_list_cont() // TODO needed (non-const)?
+        {
+            return this->arg_list_cont_;
+        }
+
+        arg_list_cont_type const& arg_list_cont() const
+        {
+            return this->arg_list_cont_;
+        }
+
+        protected:
+        par_list_cont_type par_list_cont_;
+        arg_list_cont_type arg_list_cont_;
+
+    };
+
+    template<typename ParList = ::boost::mpl::vector0<> >
+    class arg_list_generator
+    {
+
+        typedef ::boost::mpl::na na_;
+        typedef modulo_traits<ParList> modulo_traits_;
+
+        public:
+
+        typedef typename modulo_traits_::size par_list_size;
+        typedef typename modulo_traits_::cont_ par_list_cont_type;
+
+        arg_list_generator(){}
+        explicit arg_list_generator(par_list_cont_type const& p)
+            : par_list_cont_( p ){}
+
+        template<typename P>
+        struct modulo_result
+        {
+            typedef typename modulo_traits_:: template next_par_list<
+            	P
+            >::type par_list_;
+            typedef arg_list_generator<par_list_> type;
+        };
+
+        template<typename P>
+        typename modulo_result<P>::type
+        operator%(P const& p)const
+        {
+            typedef typename modulo_result<P>::type result_;
+            return result_( this->par_list_cont()( p ) );
+        }
+
+        template<std::size_t N, typename U = na_> // size?
+        struct result{
+            typedef put_pipe_aux::arg_list<ParList, N, U> type;
+        };
+
+        typename result<0>::type
+        operator()()const
+        {
+            typedef typename result<0>::type result_;
+            return result_(
+                *this,
+                ref::csv_array<na_>( _nil )
+            );
+        }
+ 
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+    protected:
+    template<typename T, typename...Args>
+    typename result<sizeof...(Args)+1, T>::type
+    impl(T& t, Args&...args)const
+    {
+        typedef typename result<sizeof...(Args)+1, T>::type result_;
+        namespace ns = ref::assign_copy;
+        return result_(
+            this->par_list_cont(),
+            ref::csv_array( t, args... )
+        );
+    }
+
+    public:
+
+    template<typename T, typename...Args>
+    typename boost::lazy_disable_if<
+        v2::type_traits::or_const<T, Args...>,
+        result<sizeof...(Args)+1, T>
+    >::type
+    operator()(T& t, Args&...args)const
+    {
+        return this->impl(t, args...);
+    }
+
+    template<typename T, typename...Args>
+    typename result<sizeof...(Args)+1, T const>::type
+    operator()(T const& t, Args const&...args)const
+    {
+        return this->impl(t, args...);
+    }
+
+#else
+
+#define BOOST_ASSIGN_V2_MACRO1(N, U)\
+    return result_( \
+        this->par_list_cont(), \
+        ref::csv_array<U>( BOOST_PP_ENUM_PARAMS(N, _) ) \
+    );\
+/**/
+#define BOOST_ASSIGN_V2_MACRO2(z, N, data)\
+    template<typename T>\
+    typename result<N, T>::type\
+    operator()( BOOST_PP_ENUM_PARAMS(N, T &_) )const \
+    { \
+        typedef typename result<N, T>::type result_;\
+        BOOST_ASSIGN_V2_MACRO1( N, T )\
+    } \
+    template<typename T>\
+    typename result<N, T const>::type\
+    operator()( BOOST_PP_ENUM_PARAMS(N, T const &_) )const \
+    { \
+        typedef typename result<N, T const>::type result_;\
+        BOOST_ASSIGN_V2_MACRO1( N, T const )\
+    } \
+/**/
+
+BOOST_PP_REPEAT_FROM_TO(
+    1,
+    BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
+    BOOST_ASSIGN_V2_MACRO2,
+    ~
+)
+#undef BOOST_ASSIGN_V2_MACRO1
+#undef BOOST_ASSIGN_V2_MACRO2
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+		par_list_cont_type const& par_list_cont()const
+        {
+        	return this->par_list_cont_;
+        }
+
+        protected:
+        par_list_cont_type par_list_cont_;
+
+    };
+
+}// put_pipe_aux
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_PIPE_ARG_LIST_HPP_ER_2010
+
Added: sandbox/assign_v2/boost/assign/v2/put/pipe/args_list.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/pipe/args_list.hpp	2011-03-09 16:15:49 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,273 @@
+//////////////////////////////////////////////////////////////////////////////
+//  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_PIPE_ARGS_LIST_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_PIPE_ARGS_LIST_ER_2010_HPP
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/vector/vector0.hpp>
+
+#include <boost/assign/v2/ref/list_tuple.hpp>
+#include <boost/assign/v2/put/pipe/modulo_traits.hpp>
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#include <boost/assign/v2/temporary/variadic_vector.hpp>
+#else
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#endif
+
+namespace boost{
+    struct use_default;
+namespace assign{
+namespace v2{
+namespace put_pipe_aux{
+
+    typedef ::boost::mpl::vector0<> empty_args_list_;
+    typedef v2::ref::list_tuple_aux::list_size_type args_list_size_type;
+
+#if! BOOST_ASSIGN_V2_ENABLE_CPP0X
+    typedef ref::list_tuple_aux::na_type na_type;
+#endif
+
+    template<typename ParList = empty_par_list_, typename ArgsList = empty_args_list_, bool enable_pars = ::boost::mpl::size<ArgsList>::value == 0>
+    class args_list;
+
+    template<typename ParList, typename ArgsList, bool enable_pars>
+    struct args_list_result
+    {
+
+        template<typename V>
+        struct next_helper
+        {
+        	typedef typename ::boost::mpl::push_back<
+            	ArgsList, V
+            >::type next_args_list_;
+        	typedef args_list<ParList,  next_args_list_,  enable_pars> type;
+        };
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+        template<typename...Args>
+        struct apply : next_helper<
+            typename ::boost::mpl::detail::variadic_vector<
+                Args...
+            >::type
+        >
+        {};
+
+#else
+
+        template<typename V>
+        struct apply : next_helper<V>{};
+
+#endif
+
+    };
+
+
+    template<typename ParList, typename ArgsList, bool enable_pars>
+    class args_list
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+        :    public functor_aux::crtp_unary_and_up<
+                args_list<ParList, ArgsList, enable_pars>,
+                args_list_result<ParList, ArgsList, enable_pars>
+            >
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+    {
+        typedef boost::use_default list_tag_;
+        typedef modulo_traits<ParList> modulo_traits_;
+        typedef ref::nth_result_of::list_tuple meta_;
+
+        public:
+
+        typedef typename modulo_traits_::size par_list_size;
+        typedef typename modulo_traits_::cont_ par_list_cont_type;
+
+        BOOST_STATIC_CONSTANT(
+            args_list_size_type, 
+            args_list_size = ::boost::mpl::size<ArgsList>::value
+        ); 
+    
+        typedef typename ::boost::mpl::apply1<
+        	meta_, ArgsList
+        >::type args_list_cont_type;
+
+        args_list(){}
+        explicit args_list(par_list_cont_type const& a, args_list_cont_type const& b) 
+        	: par_list_cont_( a ), args_list_cont_( b ){}
+
+        // operator%
+
+        template<typename P>
+        struct modulo_result
+        {
+            typedef typename modulo_traits_::template 
+            	next_par_list<P>::type par_list_;
+            typedef args_list<par_list_, ArgsList> type;
+        };
+
+        template<typename P>
+        typename boost::lazy_enable_if_c<
+            enable_pars,
+            modulo_result<P>
+        >::type
+        operator%(P const& p)const
+        {
+            typedef typename modulo_result<P>::type result_;
+            return result_(
+                this->par_list_cont()( p ),
+                this->args_list_cont()
+            );
+        }
+
+        // operator()
+
+        template<
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+            typename...Args
+#else
+            typename VArgs
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+        >
+        struct result : args_list_result<
+            ParList,
+            ArgsList,
+            enable_pars
+        >::template apply<
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+            Args...
+#else
+            VArgs
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+        >{};
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+        public:
+
+        template<typename ...Args>
+        typename result<Args...>::type
+        operator()(Args&&...args )const
+        {
+            typedef typename result<Args...>::type result_;
+            return result_(
+                this->par_list_cont(),
+                this->args_list_cont()(
+                    std::forward<Args>( args )...
+                )
+            );
+        }
+
+#else
+        protected:
+
+        typedef functor_aux::crtp_unary_and_up<
+            args_list,
+            args_list_result<ParList, ArgsList, enable_pars>
+        > super_t;
+
+        typedef ::boost::mpl::vector0<> v0_;
+
+        public:
+
+        using super_t::operator();
+
+        typename result<v0_>::type
+        operator()()const
+        {
+            typedef typename result<v0_>::type result_;
+            return result_(
+                this->par_list_cont(),
+                this->args_list_cont()()
+            );
+        }
+
+#define BOOST_ASSIGN_V2_MACRO1( z, n, data )\
+ ( BOOST_PP_CAT(_,n) )\
+/**/
+#define BOOST_ASSIGN_V2_MACRO2(z, N1, data)\
+    template<BOOST_PP_ENUM_PARAMS(N1, typename U)>\
+    typename result<\
+        ::boost::mpl::vector<\
+            BOOST_PP_ENUM_PARAMS(N1, U)\
+        >\
+    >::type\
+    impl( BOOST_PP_ENUM_BINARY_PARAMS(N1, U, &_) )const{\
+        typedef ::boost::mpl::vector<\
+            BOOST_PP_ENUM_PARAMS(N1, U)\
+        > v_;\
+        typedef typename result<v_>::type result_;\
+        return result_(\
+            this->par_list_cont(),\
+            this->args_list_cont()( BOOST_PP_ENUM_PARAMS(N1, _) )\
+        );\
+    }\
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+    1,
+    BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_ARITY),
+    BOOST_ASSIGN_V2_MACRO2,
+    ~
+)
+#undef BOOST_ASSIGN_V2_MACRO1
+#undef BOOST_ASSIGN_V2_MACRO2
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+        par_list_cont_type const& par_list_cont()const
+        {
+            return this->par_list_cont_;
+        }
+        args_list_cont_type const& args_list_cont()const
+        {
+            return this->args_list_cont_;
+        }
+
+        protected:
+
+        par_list_cont_type par_list_cont_;
+        args_list_cont_type args_list_cont_;
+
+    };
+
+    // For testing purposes
+    template<int i, int j, typename T, typename P, typename U>
+    void check_args_list(T const& args_list, P const& pred, U const& u)
+    {
+        #if BOOST_ASSIGN_V2_ENABLE_CPP0X
+        using namespace boost::assign::v2::ref; // tuple (cpp0x)
+        #else
+        using namespace boost; // tuple<> (cpp03)
+        #endif
+        
+        //std::cout << "(i,j)->" << get<j>(
+        //        args_list.args_list().get( boost::mpl::int_<i>() )
+        //    ) << std::endl;
+        
+        pred(
+            get<j>(
+                args_list.args_list_cont().get( boost::mpl::int_<i>() )
+            ),
+            u
+        );
+    }
+
+
+}// put_pipe_aux
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_PIPE_ARGS_LIST_ER_2010_HPP
Added: sandbox/assign_v2/boost/assign/v2/put/pipe/csv_put.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/pipe/csv_put.hpp	2011-03-09 16:15:49 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////////////
+//  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_PIPE_CSV_PUT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_PIPE_CSV_PUT_ER_2010_HPP
+#include <boost/assign/v2/ref/array/as_arg_list.hpp>
+#include <boost/assign/v2/ref/list/as_modulo_list.hpp>
+#include <boost/assign/v2/put/container/put.hpp>
+#include <boost/assign/v2/put/pipe/arg_list.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_pipe_aux{
+
+    template<typename C,
+        typename ParList, arg_list_size_type N, typename U>
+    C& operator|(C& cont, put_pipe_aux::arg_list<
+    		ParList, N, U
+        > const& arg_list
+    )
+    {
+
+		v2::ref::as_arg_list(
+            v2::ref::as_modulo_list<ParList>( 
+            	put( cont ), 
+                arg_list.par_list_cont() 
+            ),
+            arg_list.arg_list_cont()
+        );
+        return cont;
+
+    }
+
+}// put_pipe_aux
+
+	put_pipe_aux::arg_list_generator<> const _csv_put 
+    	= put_pipe_aux::arg_list_generator<>();
+
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_PIPE_CSV_PUT_ER_2010_HPP
Added: sandbox/assign_v2/boost/assign/v2/put/pipe/put.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/pipe/put.hpp	2011-03-09 16:15:49 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+//  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_PIPE_PUT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_PIPE_PUT_ER_2010_HPP
+#include <boost/assign/v2/ref/list/as_modulo_list.hpp>
+#include <boost/assign/v2/ref/list_tuple/as_args_list.hpp>
+#include <boost/assign/v2/put/container/put.hpp>
+#include <boost/assign/v2/put/pipe/args_list.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_pipe_aux{
+
+    template<
+        typename C,
+        typename ParList,
+        typename ArgsList,
+        bool enable_pars
+    >
+    C& operator|(
+        C& cont,
+        put_pipe_aux::args_list<
+        	ParList, ArgsList, enable_pars
+        > const& args_list_
+    ){
+		ref::as_args_list(
+            ref::as_modulo_list<ParList>( 
+            	put( cont ), args_list_.par_list_cont() 
+            ),
+            args_list_.args_list_cont()
+        );
+        return cont;
+    }
+
+}// put_pipe_aux
+namespace{
+
+    put_pipe_aux::args_list<> const _put = put_pipe_aux::args_list<>();
+
+}
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_PIPE_FUNCTOR_OPERATOR_ER_2010_HPP