Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69640 - in sandbox/assign_v2/boost/assign/v2/ref: array list_tuple/cpp03 list_tuple/cpp0x
From: erwann.rogard_at_[hidden]
Date: 2011-03-07 20:18:12


Author: e_r
Date: 2011-03-07 20:18:09 EST (Mon, 07 Mar 2011)
New Revision: 69640
URL: http://svn.boost.org/trac/boost/changeset/69640

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/ref/array/as_arglist.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp03/as_arglist.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp0x/as_arglist.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/ref/array/as_arglist.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/ref/array/as_arglist.hpp 2011-03-07 20:18:09 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,63 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_ARGLIST_ER_2010_HPP
+#define BOOST_ASSIGN_V2_REF_ARRAY_AS_ARGLIST_ER_2010_HPP
+#include <boost/utility/enable_if.hpp>
+#include <boost/assign/v2/ref/array/interface.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_arglist(
+ 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_arglist(
+ F const& f ,
+ interface<Impl, D> const& array
+ )
+ {
+ f( array[ I ].get() );
+ as_arglist<I + 1>( f, array );
+ }
+
+ // --- User interface --- //
+
+ template<typename F, typename Impl, typename D>
+ void as_arglist(
+ F const& f ,
+ interface<Impl, D> const& array
+ ){
+ as_arglist<0>( f, array );
+ }
+
+}// array_aux
+using array_aux::as_arglist;
+}// ref
+}// v2
+}// assign
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp03/as_arglist.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp03/as_arglist.hpp 2011-03-07 20:18:09 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,91 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_LIST_TUPLE_CPP03_AS_ARGLIST_ER_2010_HPP
+#define BOOST_ASSIGN_V2_REF_LIST_TUPLE_CPP03_AS_ARGLIST_ER_2010_HPP
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/assign/v2/ref/tuple/cpp03/as_arglist.hpp>
+#include <boost/assign/v2/ref/list_tuple/container.hpp>
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/ref/list_tuple/size_type.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace ref{
+namespace list_tuple_aux{
+
+#define BOOST_ASSIGN_V2_params(T) BOOST_PP_ENUM_PARAMS(BOOST_ASSIGN_V2_LIMIT_ARITY,T)
+
+ // --- Implementation --- //
+
+ template<
+ typename F,
+ list_size_type N, typename L, BOOST_ASSIGN_V2_params(typename T)
+ >
+ void as_arglist(
+ F const& f ,
+ ::boost::mpl::int_<N>,
+ container<N, L, BOOST_ASSIGN_V2_params(T)> const& list
+ )
+ {}
+
+ template<
+ typename F,
+ list_size_type I,
+ list_size_type N,
+ typename L, BOOST_ASSIGN_V2_params(typename T)
+ >
+ void as_arglist(
+ F const& f ,
+ ::boost::mpl::int_<I>,
+ container<N, L, BOOST_ASSIGN_V2_params(T)> const& list
+ )
+ {
+ {
+ typedef ::boost::mpl::int_<I> int_;
+ as_arglist( f, list.get( int_() ) );
+ }
+ {
+ typedef ::boost::mpl::int_<I+1> next_;
+ as_arglist( f, next_(), list );
+ }
+ }
+
+ // ----- User interface ----- //
+
+ template<typename F, typename L>
+ void as_arglist(
+ F const& f ,
+ container<0, L> const& list
+ ){}
+
+ template<typename F,
+ list_size_type N, typename L, BOOST_ASSIGN_V2_params(typename T)>
+ void as_arglist(
+ F const& f,
+ container<N, L, BOOST_ASSIGN_V2_params(T)> const& list
+ )
+ {
+ typedef ::boost::mpl::int_<0> int_;
+ as_arglist(f, int_(), list);
+ }
+
+#undef BOOST_ASSIGN_V2_params
+
+}// list_tuple_aux
+using list_tuple_aux::as_arglist;
+}// ref
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp0x/as_arglist.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/ref/list_tuple/cpp0x/as_arglist.hpp 2011-03-07 20:18:09 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,85 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_LIST_TUPLE_CPP0X_AS_ARGLIST_ER_2010_HPP
+#define BOOST_ASSIGN_V2_REF_LIST_TUPLE_CPP0X_AS_ARGLIST_ER_2010_HPP
+#include <boost/mpl/size.hpp>
+#include <boost/assign/v2/ref/tuple/cpp0x/as_arglist.hpp>
+#include <boost/assign/v2/ref/list_tuple/container.hpp>
+#include <boost/assign/v2/temporary/variadic_args_to_indices.hpp>
+#include <boost/assign/v2/ref/list_tuple/size_type.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace ref{
+namespace list_tuple_aux{
+
+
+ // --- List --- //
+
+ template<
+ typename F,
+ list_size_type N, typename L, typename...Args
+ >
+ void as_arglist(
+ F const& f ,
+ ::boost::mpl::int_<N>,
+ container<N, L, Args...> const& list
+ )
+ {}
+
+ template<
+ typename F,
+ list_size_type I,
+ list_size_type N, typename L, typename...Args
+ >
+ void as_arglist(
+ F const& f ,
+ ::boost::mpl::int_<I>,
+ container<N, L, Args...> const& list
+ )
+ {
+ {
+ typedef ::boost::mpl::int_<I> int_;
+ as_arglist( f, list.get( int_() ) ); // tuple
+ }
+ {
+ typedef ::boost::mpl::int_<I+1> next_;
+ as_arglist( f, next_(), list );
+ }
+ }
+
+ // ------------ //
+
+ template<typename F, typename L>
+ void as_arglist(
+ F const& f ,
+ container<0, L> const& list
+ ){}
+
+ template<typename F,
+ list_size_type N, typename L, typename...Args>
+ void as_arglist(
+ F const& f,
+ container<N, L, Args...> const& list
+ )
+ {
+ typedef ::boost::mpl::int_<0> int_;
+ as_arglist(f, int_(), list);
+ }
+
+}// list_tuple_aux
+using list_tuple_aux::as_arglist;
+}// ref
+}// v2
+}// assign
+}// boost
+
+#endif


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