Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71758 - in trunk: boost/proto boost/proto/detail boost/proto/detail/preprocessed libs/proto/preprocess
From: eric_at_[hidden]
Date: 2011-05-06 05:03:43


Author: eric_niebler
Date: 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
New Revision: 71758
URL: http://svn.boost.org/trac/boost/changeset/71758

Log:
pre-preprocess make_expr, unpack_expr and by_value_generator
Added:
   trunk/boost/proto/detail/generate_by_value.hpp (contents, props changed)
   trunk/boost/proto/detail/make_expr.hpp (contents, props changed)
   trunk/boost/proto/detail/make_expr_.hpp (contents, props changed)
   trunk/boost/proto/detail/make_expr_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/generate_by_value.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/make_expr.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/make_expr_.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/make_expr_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/unpack_expr_.hpp (contents, props changed)
   trunk/boost/proto/detail/unpack_expr_.hpp (contents, props changed)
Text files modified:
   trunk/boost/proto/detail/basic_expr.hpp | 1
   trunk/boost/proto/detail/preprocessed/basic_expr.hpp | 1
   trunk/boost/proto/generate.hpp | 8
   trunk/boost/proto/make_expr.hpp | 1204 ++++++++++++++-------------------------
   trunk/libs/proto/preprocess/preprocess_proto.cpp | 2
   5 files changed, 446 insertions(+), 770 deletions(-)

Modified: trunk/boost/proto/detail/basic_expr.hpp
==============================================================================
--- trunk/boost/proto/detail/basic_expr.hpp (original)
+++ trunk/boost/proto/detail/basic_expr.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -42,7 +42,6 @@
     #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/basic_expr.hpp>))
     #include BOOST_PP_ITERATE()
 
- // Generate non-variadic versions of expr and basic_expr
     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
         #pragma wave option(output: null)
     #endif

Added: trunk/boost/proto/detail/generate_by_value.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/generate_by_value.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,91 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/generate_by_value.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/generate_by_value.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file generate_by_value.hpp
+ /// Contains definition of by_value_generator_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/generate_by_value.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
+ struct by_value_generator_<
+ proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
+ >
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
+ src_args;
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
+ >
+ dst_args;
+
+ typedef proto::expr<Tag, src_args, N> src_type;
+ typedef proto::expr<Tag, dst_args, N> type;
+
+ static type const call(src_type const &e)
+ {
+ type that = {
+ BOOST_PP_ENUM_PARAMS(N, e.child)
+ };
+ return that;
+ }
+ };
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
+ >
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
+ src_args;
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
+ >
+ dst_args;
+
+ typedef proto::basic_expr<Tag, src_args, N> src_type;
+ typedef proto::basic_expr<Tag, dst_args, N> type;
+
+ static type const call(src_type const &e)
+ {
+ type that = {
+ BOOST_PP_ENUM_PARAMS(N, e.child)
+ };
+ return that;
+ }
+ };
+
+ #undef N
+
+#endif

Added: trunk/boost/proto/detail/make_expr.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/make_expr.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,73 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr.hpp
+ /// Contains overloads of make_expr() free function.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \overload
+ ///
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >
+ >::type const
+ make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >()(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ /// \overload
+ ///
+ template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename C)>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
+ >::type const
+ make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const C, &c))
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
+ >()(BOOST_PP_ENUM_PARAMS(N, c));
+ }
+
+ #undef N
+
+#endif

Added: trunk/boost/proto/detail/make_expr_.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/make_expr_.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,103 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr_.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ template<
+ typename Tag
+ , typename Domain
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ BOOST_PROTO_MAX_ARITY
+ , typename A
+ , = void BOOST_PP_INTERCEPT
+ )
+ , typename _ = void
+ >
+ struct make_expr_
+ {};
+
+ template<typename Domain, typename A>
+ struct make_expr_<tag::terminal, Domain, A
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
+ {
+ typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
+
+ result_type operator()(typename add_reference<A>::type a) const
+ {
+ return proto::detail::protoify<A, Domain>()(a);
+ }
+ };
+
+ template<typename A>
+ struct make_expr_<tag::terminal, deduce_domain, A
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
+ : make_expr_<tag::terminal, default_domain, A>
+ {};
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+ #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
+
+ template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
+ {
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain))
+ >
+ proto_args;
+
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+
+ result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
+ {
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
+ };
+ return proto_generator()(that);
+ }
+ };
+
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
+ : make_expr_<
+ Tag
+ , typename BOOST_PP_CAT(deduce_domain, N)<BOOST_PP_ENUM_PARAMS(N, A)>::type
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ >
+ {};
+
+ #undef N
+ #undef M
+
+#endif

Added: trunk/boost/proto/detail/make_expr_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/make_expr_funop.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,66 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/make_expr_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_funop.hpp
+ /// Contains definition of make_expr\<\>::operator() member functions.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ >::type
+ type;
+ };
+
+ /// \overload
+ ///
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >::type const
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
+ >()(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ #undef N
+
+#endif

Modified: trunk/boost/proto/detail/preprocessed/basic_expr.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/basic_expr.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/basic_expr.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -432,4 +432,3 @@
         
         typedef detail::not_a_valid_type address_of_hack_type_;
     };
-

Added: trunk/boost/proto/detail/preprocessed/generate_by_value.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/generate_by_value.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,237 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file generate_by_value.hpp
+ /// Contains definition of by_value_generator_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+ template<typename Tag , typename Arg0 >
+ struct by_value_generator_<
+ proto::expr<Tag, list1<Arg0>, 1>
+ >
+ {
+ typedef
+ list1<Arg0>
+ src_args;
+ typedef
+ list1<
+ typename uncvref<Arg0 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 1> src_type;
+ typedef proto::expr<Tag, dst_args, 1> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list1<Arg0>, 1>
+ >
+ {
+ typedef
+ list1<Arg0>
+ src_args;
+ typedef
+ list1<
+ typename uncvref<Arg0 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 1> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 1> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 >
+ struct by_value_generator_<
+ proto::expr<Tag, list2<Arg0 , Arg1>, 2>
+ >
+ {
+ typedef
+ list2<Arg0 , Arg1>
+ src_args;
+ typedef
+ list2<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 2> src_type;
+ typedef proto::expr<Tag, dst_args, 2> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list2<Arg0 , Arg1>, 2>
+ >
+ {
+ typedef
+ list2<Arg0 , Arg1>
+ src_args;
+ typedef
+ list2<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 2> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 2> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
+ struct by_value_generator_<
+ proto::expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
+ >
+ {
+ typedef
+ list3<Arg0 , Arg1 , Arg2>
+ src_args;
+ typedef
+ list3<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 3> src_type;
+ typedef proto::expr<Tag, dst_args, 3> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3>
+ >
+ {
+ typedef
+ list3<Arg0 , Arg1 , Arg2>
+ src_args;
+ typedef
+ list3<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 3> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 3> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
+ struct by_value_generator_<
+ proto::expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
+ >
+ {
+ typedef
+ list4<Arg0 , Arg1 , Arg2 , Arg3>
+ src_args;
+ typedef
+ list4<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 4> src_type;
+ typedef proto::expr<Tag, dst_args, 4> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4>
+ >
+ {
+ typedef
+ list4<Arg0 , Arg1 , Arg2 , Arg3>
+ src_args;
+ typedef
+ list4<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 4> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 4> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
+ struct by_value_generator_<
+ proto::expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
+ >
+ {
+ typedef
+ list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
+ src_args;
+ typedef
+ list5<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
+ >
+ dst_args;
+ typedef proto::expr<Tag, src_args, 5> src_type;
+ typedef proto::expr<Tag, dst_args, 5> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4
+ };
+ return that;
+ }
+ };
+ template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
+ struct by_value_generator_<
+ proto::basic_expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5>
+ >
+ {
+ typedef
+ list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>
+ src_args;
+ typedef
+ list5<
+ typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type
+ >
+ dst_args;
+ typedef proto::basic_expr<Tag, src_args, 5> src_type;
+ typedef proto::basic_expr<Tag, dst_args, 5> type;
+ static type const call(src_type const &e)
+ {
+ type that = {
+ e.child0 , e.child1 , e.child2 , e.child3 , e.child4
+ };
+ return that;
+ }
+ };

Added: trunk/boost/proto/detail/preprocessed/make_expr.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/make_expr.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,143 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr.hpp
+ /// Contains overloads of make_expr() free function.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+
+ template<typename Tag , typename A0 , typename A1>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1
+ >()(a0 , a1);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1
+ >()(c0 , c1);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2
+ >()(a0 , a1 , a2);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2
+ >()(c0 , c1 , c2);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3
+ >()(a0 , a1 , a2 , a3);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3
+ >()(c0 , c1 , c2 , c3);
+ }
+
+
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >
+ >::type const
+ make_expr(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >()(a0 , a1 , a2 , a3 , a4);
+ }
+
+
+ template<typename Tag, typename Domain , typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4
+ >::type const
+ make_expr(const C0 &c0 , const C1 &c1 , const C2 &c2 , const C3 &c3 , const C4 &c4)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const C0 , const C1 , const C2 , const C3 , const C4
+ >()(c0 , c1 , c2 , c3 , c4);
+ }

Added: trunk/boost/proto/detail/preprocessed/make_expr_.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/make_expr_.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,175 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+ template<
+ typename Tag
+ , typename Domain
+ , typename A0 = void , typename A1 = void , typename A2 = void , typename A3 = void , typename A4 = void
+ , typename _ = void
+ >
+ struct make_expr_
+ {};
+ template<typename Domain, typename A>
+ struct make_expr_<tag::terminal, Domain, A
+ , void , void , void , void , void>
+ {
+ typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
+ result_type operator()(typename add_reference<A>::type a) const
+ {
+ return proto::detail::protoify<A, Domain>()(a);
+ }
+ };
+ template<typename A>
+ struct make_expr_<tag::terminal, deduce_domain, A
+ , void , void , void , void , void>
+ : make_expr_<tag::terminal, default_domain, A>
+ {};
+ template<typename Tag, typename Domain , typename A0>
+ struct make_expr_<Tag, Domain , A0
+ , void , void , void , void, void>
+ {
+ typedef
+ list1<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0>
+ struct make_expr_<Tag, deduce_domain , A0
+ , void , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain1<A0>::type
+ , A0
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1>
+ struct make_expr_<Tag, Domain , A0 , A1
+ , void , void , void, void>
+ {
+ typedef
+ list2<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1>
+ struct make_expr_<Tag, deduce_domain , A0 , A1
+ , void , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain2<A0 , A1>::type
+ , A0 , A1
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2
+ , void , void, void>
+ {
+ typedef
+ list3<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2
+ , void , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain3<A0 , A1 , A2>::type
+ , A0 , A1 , A2
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3
+ , void, void>
+ {
+ typedef
+ list4<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3
+ , void, void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain4<A0 , A1 , A2 , A3>::type
+ , A0 , A1 , A2 , A3
+ >
+ {};
+ template<typename Tag, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make_expr_<Tag, Domain , A0 , A1 , A2 , A3 , A4
+ , void>
+ {
+ typedef
+ list5<
+ typename boost::proto::detail::protoify< A0 , Domain >::result_type , typename boost::proto::detail::protoify< A1 , Domain >::result_type , typename boost::proto::detail::protoify< A2 , Domain >::result_type , typename boost::proto::detail::protoify< A3 , Domain >::result_type , typename boost::proto::detail::protoify< A4 , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
+ result_type operator()(typename add_reference<A0 >::type a0 , typename add_reference<A1 >::type a1 , typename add_reference<A2 >::type a2 , typename add_reference<A3 >::type a3 , typename add_reference<A4 >::type a4) const
+ {
+ expr_type const that = {
+ boost::proto::detail::protoify< A0 , Domain >()(a0) , boost::proto::detail::protoify< A1 , Domain >()(a1) , boost::proto::detail::protoify< A2 , Domain >()(a2) , boost::proto::detail::protoify< A3 , Domain >()(a3) , boost::proto::detail::protoify< A4 , Domain >()(a4)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make_expr_<Tag, deduce_domain , A0 , A1 , A2 , A3 , A4
+ , void>
+ : make_expr_<
+ Tag
+ , typename deduce_domain5<A0 , A1 , A2 , A3 , A4>::type
+ , A0 , A1 , A2 , A3 , A4
+ >
+ {};

Added: trunk/boost/proto/detail/preprocessed/make_expr_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/make_expr_funop.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,115 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_funop.hpp
+ /// Contains definition of make_expr\<\>::operator() member functions.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+ template<typename This , typename A0 , typename A1>
+ struct result<This(A0 , A1)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1
+ >()(a0 , a1);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2>
+ struct result<This(A0 , A1 , A2)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2
+ >()(a0 , a1 , a2);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3>
+ struct result<This(A0 , A1 , A2 , A3)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3
+ >()(a0 , a1 , a2 , a3);
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct result<This(A0 , A1 , A2 , A3 , A4)>
+ {
+ typedef
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 , A1 , A2 , A3 , A4
+ >::type
+ type;
+ };
+
+
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >::type const
+ operator ()(const A0 &a0 , const A1 &a1 , const A2 &a2 , const A3 &a3 , const A4 &a4) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , const A0 , const A1 , const A2 , const A3 , const A4
+ >()(a0 , a1 , a2 , a3 , a4);
+ }

Added: trunk/boost/proto/detail/preprocessed/unpack_expr_.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/unpack_expr_.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,240 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+ template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
+ struct unpack_expr_
+ {};
+ template<typename Domain, typename Sequence>
+ struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ {
+ typedef
+ typename add_const<
+ typename fusion::result_of::value_of<
+ typename fusion::result_of::begin<Sequence>::type
+ >::type
+ >::type
+ terminal_type;
+ typedef
+ typename proto::detail::protoify<
+ terminal_type
+ , Domain
+ >::result_type
+ type;
+ static type const call(Sequence const &sequence)
+ {
+ return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
+ }
+ };
+ template<typename Sequence>
+ struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
+ : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
+ {};
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 1>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0;
+ typedef
+ list1<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 1>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain1<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type
+ >::type
+ , Sequence
+ , 1
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 2>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1;
+ typedef
+ list2<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 2>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain2<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type
+ >::type
+ , Sequence
+ , 2
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 3>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2;
+ typedef
+ list3<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 3>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain3<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type
+ >::type
+ , Sequence
+ , 3
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 4>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3;
+ typedef
+ list4<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 4>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain4<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type
+ >::type
+ , Sequence
+ , 4
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, 5>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4;
+ typedef
+ list5<
+ typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >::result_type , typename detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >::result_type
+ >
+ proto_args;
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+ static type const call(Sequence const &sequence)
+ {
+ fusion_iterator0 it0 = fusion::begin(sequence); fusion_iterator1 it1 = fusion::next(it0); fusion_iterator2 it2 = fusion::next(it1); fusion_iterator3 it3 = fusion::next(it2); fusion_iterator4 it4 = fusion::next(it3);
+ expr_type const that = {
+ detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , Domain >()(*it0) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , Domain >()(*it1) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , Domain >()(*it2) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , Domain >()(*it3) , detail::protoify< typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type , Domain >()(*it4)
+ };
+ return proto_generator()(that);
+ }
+ };
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, 5>
+ {
+ typedef typename fusion::result_of::begin<Sequence const>::type fusion_iterator0; typedef typename fusion::result_of::next< fusion_iterator0>::type fusion_iterator1; typedef typename fusion::result_of::next< fusion_iterator1>::type fusion_iterator2; typedef typename fusion::result_of::next< fusion_iterator2>::type fusion_iterator3; typedef typename fusion::result_of::next< fusion_iterator3>::type fusion_iterator4;
+ typedef
+ unpack_expr_<
+ Tag
+ , typename deduce_domain5<
+ typename add_const< typename fusion::result_of::value_of< fusion_iterator0 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator1 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator2 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator3 >::type >::type , typename add_const< typename fusion::result_of::value_of< fusion_iterator4 >::type >::type
+ >::type
+ , Sequence
+ , 5
+ >
+ other;
+ typedef typename other::type type;
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };

Added: trunk/boost/proto/detail/unpack_expr_.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/unpack_expr_.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -0,0 +1,195 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/unpack_expr_.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE(Z, N, DATA) \
+ typedef typename fusion::result_of::next< \
+ BOOST_PP_CAT(fusion_iterator, N)>::type \
+ BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)); \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_ITERATORS_TYPE(N) \
+ typedef \
+ typename fusion::result_of::begin<Sequence const>::type \
+ fusion_iterator0; \
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE, fusion_iterator) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ typename add_const< \
+ typename fusion::result_of::value_of< \
+ BOOST_PP_CAT(fusion_iterator, N) \
+ >::type \
+ >::type \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_NEXT_ITERATOR(Z, N, DATA) \
+ BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)) BOOST_PP_CAT(it, BOOST_PP_INC(N)) = \
+ fusion::next(BOOST_PP_CAT(it, N)); \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_ITERATORS(N) \
+ fusion_iterator0 it0 = fusion::begin(sequence); \
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR, fusion_iterator) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AT(Z, N, DATA) \
+ *BOOST_PP_CAT(it, N) \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE(Z, N, DATA) \
+ typename detail::protoify< \
+ BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ , Domain \
+ >::result_type \
+ /**/
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_FUSION_AS_CHILD_AT(Z, N, DATA) \
+ detail::protoify< \
+ BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
+ , Domain \
+ >()(BOOST_PROTO_FUSION_AT(Z, N, DATA)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/unpack_expr_.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file make_expr_.hpp
+ /// Contains definition of make_expr_\<\> class template.
+ //
+ // Copyright 2008 Eric Niebler. Distributed under 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)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
+ struct unpack_expr_
+ {};
+
+ template<typename Domain, typename Sequence>
+ struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ {
+ typedef
+ typename add_const<
+ typename fusion::result_of::value_of<
+ typename fusion::result_of::begin<Sequence>::type
+ >::type
+ >::type
+ terminal_type;
+
+ typedef
+ typename proto::detail::protoify<
+ terminal_type
+ , Domain
+ >::result_type
+ type;
+
+ static type const call(Sequence const &sequence)
+ {
+ return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
+ }
+ };
+
+ template<typename Sequence>
+ struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
+ : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
+ {};
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/unpack_expr_.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_FUSION_AT
+ #undef BOOST_PROTO_FUSION_AT_TYPE
+ #undef BOOST_PROTO_FUSION_AS_CHILD_AT
+ #undef BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE
+ #undef BOOST_PROTO_FUSION_NEXT_ITERATOR
+ #undef BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE
+ #undef BOOST_PROTO_FUSION_ITERATORS
+ #undef BOOST_PROTO_FUSION_ITERATORS_TYPE
+
+#else // BOOST_PP_IS_ITERATING
+
+ #define N BOOST_PP_ITERATION()
+ #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
+
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr_<Tag, Domain, Sequence, N>
+ {
+ BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
+
+ typedef
+ BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE, ~)
+ >
+ proto_args;
+
+ typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
+
+ static type const call(Sequence const &sequence)
+ {
+ BOOST_PROTO_FUSION_ITERATORS(N)
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT, ~)
+ };
+ return proto_generator()(that);
+ }
+ };
+
+ template<typename Tag, typename Sequence>
+ struct unpack_expr_<Tag, deduce_domain, Sequence, N>
+ {
+ BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
+
+ typedef
+ unpack_expr_<
+ Tag
+ , typename BOOST_PP_CAT(deduce_domain, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AT_TYPE, ~)
+ >::type
+ , Sequence
+ , N
+ >
+ other;
+
+ typedef typename other::type type;
+
+ static type const call(Sequence const &sequence)
+ {
+ return other::call(sequence);
+ }
+ };
+
+ #undef N
+ #undef M
+
+#endif

Modified: trunk/boost/proto/generate.hpp
==============================================================================
--- trunk/boost/proto/generate.hpp (original)
+++ trunk/boost/proto/generate.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -69,12 +69,8 @@
                 }
             };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/generate.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_DEFINE_BY_VALUE
- #undef BOOST_PROTO_DEFINE_BY_VALUE_TYPE
-
+ // Include the other specializations of by_value_generator_
+ #include <boost/proto/detail/generate_by_value.hpp>
         }
 
         /// \brief A simple generator that passes an expression

Modified: trunk/boost/proto/make_expr.hpp
==============================================================================
--- trunk/boost/proto/make_expr.hpp (original)
+++ trunk/boost/proto/make_expr.hpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -1,821 +1,501 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file make_expr.hpp
- /// Definition of the \c make_expr() and \c unpack_expr() utilities for
- /// building Proto expression nodes from child nodes or from a Fusion
- /// sequence of child nodes, respectively.
- //
- // Copyright 2008 Eric Niebler. Distributed under 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_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
- #define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
-
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/punctuation/comma_if.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/ref.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/assert.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/type_traits/add_reference.hpp>
- #include <boost/type_traits/remove_cv.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/domain.hpp>
- #include <boost/proto/generate.hpp>
- #include <boost/fusion/include/begin.hpp>
- #include <boost/fusion/include/next.hpp>
- #include <boost/fusion/include/value_of.hpp>
- #include <boost/fusion/include/size.hpp>
- #include <boost/proto/detail/poly_function.hpp>
- #include <boost/proto/detail/deprecated.hpp>
-
- #ifdef _MSC_VER
- # pragma warning(push)
- # pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
- #endif
+///////////////////////////////////////////////////////////////////////////////
+/// \file make_expr.hpp
+/// Definition of the \c make_expr() and \c unpack_expr() utilities for
+/// building Proto expression nodes from child nodes or from a Fusion
+/// sequence of child nodes, respectively.
+//
+// Copyright 2008 Eric Niebler. Distributed under 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_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
+#define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/ref.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/domain.hpp>
+#include <boost/proto/generate.hpp>
+#include <boost/fusion/include/begin.hpp>
+#include <boost/fusion/include/next.hpp>
+#include <boost/fusion/include/value_of.hpp>
+#include <boost/fusion/include/size.hpp>
+#include <boost/proto/detail/poly_function.hpp>
+#include <boost/proto/detail/deprecated.hpp>
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
+#endif
+
+namespace boost { namespace proto
+{
+/// INTERNAL ONLY
+///
+#define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
+ typename boost::proto::detail::protoify< \
+ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
+ , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
+ >::result_type \
+ /**/
+
+/// INTERNAL ONLY
+///
+#define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
+ boost::proto::detail::protoify< \
+ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
+ , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
+ >()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
+ /**/
 
- namespace boost { namespace proto
+ namespace detail
     {
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
- typename boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >::result_type \
- /**/
+ template<typename T, typename Domain>
+ struct protoify
+ : Domain::template as_expr<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
- boost::proto::detail::protoify< \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
- , BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
- >()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<T &, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE(Z, N, DATA) \
- typedef typename fusion::result_of::next< \
- BOOST_PP_CAT(fusion_iterator, N)>::type \
- BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)); \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<boost::reference_wrapper<T>, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_ITERATORS_TYPE(N) \
- typedef \
- typename fusion::result_of::begin<Sequence const>::type \
- fusion_iterator0; \
- BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE, fusion_iterator) \
- /**/
+ template<typename T, typename Domain>
+ struct protoify<boost::reference_wrapper<T> const, Domain>
+ : Domain::template as_child<T>
+ {};
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- typename add_const< \
- typename fusion::result_of::value_of< \
- BOOST_PP_CAT(fusion_iterator, N) \
- >::type \
- >::type \
- /**/
+ // Definition of detail::unpack_expr_
+ #include <boost/proto/detail/unpack_expr_.hpp>
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_NEXT_ITERATOR(Z, N, DATA) \
- BOOST_PP_CAT(fusion_iterator, BOOST_PP_INC(N)) BOOST_PP_CAT(it, BOOST_PP_INC(N)) = \
- fusion::next(BOOST_PP_CAT(it, N)); \
- /**/
+ // Definition of detail::make_expr_
+ #include <boost/proto/detail/make_expr_.hpp>
+ }
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_ITERATORS(N) \
- fusion_iterator0 it0 = fusion::begin(sequence); \
- BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_PROTO_FUSION_NEXT_ITERATOR, fusion_iterator) \
- /**/
-
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AT(Z, N, DATA) \
- *BOOST_PP_CAT(it, N) \
- /**/
+ namespace result_of
+ {
+ /// \brief Metafunction that computes the return type of the
+ /// \c make_expr() function, with a domain deduced from the
+ /// domains of the children.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to
+ /// compute the return type of the \c make_expr() function.
+ ///
+ /// In this specialization, the domain is deduced from the
+ /// domains of the child types. (If
+ /// <tt>is_domain\<A0\>::value</tt> is \c true, then another
+ /// specialization is selected.)
+ template<
+ typename Tag
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
+ , typename Void1 // = void
+ , typename Void2 // = void
+ >
+ struct make_expr
+ {
+ /// Same as <tt>result_of::make_expr\<Tag, D, A0, ... AN\>::type</tt>
+ /// where \c D is the deduced domain, which is calculated as follows:
+ ///
+ /// For each \c x in <tt>[0,N)</tt> (proceeding in order beginning with
+ /// <tt>x=0</tt>), if <tt>domain_of\<Ax\>::type</tt> is not
+ /// \c default_domain, then \c D is <tt>domain_of\<Ax\>::type</tt>.
+ /// Otherwise, \c D is \c default_domain.
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , deduce_domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >::result_type
+ type;
+ };
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE(Z, N, DATA) \
- typename detail::protoify< \
- BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- , Domain \
- >::result_type \
- /**/
+ /// \brief Metafunction that computes the return type of the
+ /// \c make_expr() function, within the specified domain.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
+ /// the return type of the \c make_expr() function.
+ template<
+ typename Tag
+ , typename Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
+ >
+ struct make_expr<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ , typename Domain::proto_is_domain_
+ >
+ {
+ /// If \c Tag is <tt>tag::terminal</tt>, then \c type is a
+ /// typedef for <tt>boost::result_of\<Domain(expr\<tag::terminal,
+ /// term\<A0\> \>)\>::type</tt>.
+ ///
+ /// Otherwise, \c type is a typedef for <tt>boost::result_of\<Domain(expr\<Tag,
+ /// listN\< as_child\<A0\>::type, ... as_child\<AN\>::type\>)
+ /// \>::type</tt>, where \c N is the number of non-void template
+ /// arguments, and <tt>as_child\<A\>::type</tt> is evaluated as
+ /// follows:
+ ///
+ /// \li If <tt>is_expr\<A\>::value</tt> is \c true, then the
+ /// child type is \c A.
+ /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
+ /// and <tt>is_expr\<B\>::value</tt> is \c true, then the
+ /// child type is <tt>B &</tt>.
+ /// \li If <tt>is_expr\<A\>::value</tt> is \c false, then the
+ /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<A\> \>
+ /// )\>::type</tt>.
+ /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
+ /// and <tt>is_expr\<B\>::value</tt> is \c false, then the
+ /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<B &\> \>
+ /// )\>::type</tt>.
+ typedef
+ typename detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >::result_type
+ type;
+ };
 
- /// INTERNAL ONLY
- ///
- #define BOOST_PROTO_FUSION_AS_CHILD_AT(Z, N, DATA) \
- detail::protoify< \
- BOOST_PROTO_FUSION_AT_TYPE(Z, N, DATA) \
- , Domain \
- >()(BOOST_PROTO_FUSION_AT(Z, N, DATA)) \
- /**/
+ /// \brief Metafunction that computes the return type of the
+ /// \c unpack_expr() function, with a domain deduced from the
+ /// domains of the children.
+ ///
+ /// Use the <tt>result_of::unpack_expr\<\></tt> metafunction to
+ /// compute the return type of the \c unpack_expr() function.
+ ///
+ /// \c Sequence is a Fusion Forward Sequence.
+ ///
+ /// In this specialization, the domain is deduced from the
+ /// domains of the child types. (If
+ /// <tt>is_domain\<Sequence>::value</tt> is \c true, then another
+ /// specialization is selected.)
+ template<
+ typename Tag
+ , typename Sequence
+ , typename Void1 // = void
+ , typename Void2 // = void
+ >
+ struct unpack_expr
+ {
+ /// Let \c S be the type of a Fusion Random Access Sequence
+ /// equivalent to \c Sequence. Then \c type is the
+ /// same as <tt>result_of::make_expr\<Tag,
+ /// fusion::result_of::value_at_c\<S, 0\>::type, ...
+ /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
+ /// where \c N is the size of \c S.
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >::type
+ type;
+ };
 
- namespace detail
+ /// \brief Metafunction that computes the return type of the
+ /// \c unpack_expr() function, within the specified domain.
+ ///
+ /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
+ /// the return type of the \c make_expr() function.
+ template<typename Tag, typename Domain, typename Sequence>
+ struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
         {
- template<typename T, typename Domain>
- struct protoify
- : Domain::template as_expr<T>
- {};
-
- template<typename T, typename Domain>
- struct protoify<T &, Domain>
- : Domain::template as_child<T>
- {};
-
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T>, Domain>
- : Domain::template as_child<T>
- {};
+ /// Let \c S be the type of a Fusion Random Access Sequence
+ /// equivalent to \c Sequence. Then \c type is the
+ /// same as <tt>result_of::make_expr\<Tag, Domain,
+ /// fusion::result_of::value_at_c\<S, 0\>::type, ...
+ /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
+ /// where \c N is the size of \c S.
+ typedef
+ typename detail::unpack_expr_<
+ Tag
+ , Domain
+ , Sequence
+ , fusion::result_of::size<Sequence>::type::value
+ >::type
+ type;
+ };
+ }
 
- template<typename T, typename Domain>
- struct protoify<boost::reference_wrapper<T> const, Domain>
- : Domain::template as_child<T>
- {};
+ namespace functional
+ {
+ /// \brief A callable function object equivalent to the
+ /// \c proto::make_expr() function.
+ ///
+ /// In all cases, <tt>functional::make_expr\<Tag, Domain\>()(a0, ... aN)</tt>
+ /// is equivalent to <tt>proto::make_expr\<Tag, Domain\>(a0, ... aN)</tt>.
+ ///
+ /// <tt>functional::make_expr\<Tag\>()(a0, ... aN)</tt>
+ /// is equivalent to <tt>proto::make_expr\<Tag\>(a0, ... aN)</tt>.
+ template<typename Tag, typename Domain /* = deduce_domain*/>
+ struct make_expr
+ {
+ BOOST_PROTO_CALLABLE()
+ BOOST_PROTO_POLY_FUNCTION()
 
- template<typename Tag, typename Domain, typename Sequence, std::size_t Size>
- struct unpack_expr_
- {};
+ template<typename Sig>
+ struct result;
 
- template<typename Domain, typename Sequence>
- struct unpack_expr_<tag::terminal, Domain, Sequence, 1u>
+ template<typename This, typename A0>
+ struct result<This(A0)>
             {
                 typedef
- typename add_const<
- typename fusion::result_of::value_of<
- typename fusion::result_of::begin<Sequence>::type
- >::type
- >::type
- terminal_type;
-
- typedef
- typename proto::detail::protoify<
- terminal_type
+ typename result_of::make_expr<
+ Tag
                       , Domain
- >::result_type
+ , A0
+ >::type
                 type;
-
- static type const call(Sequence const &sequence)
- {
- return proto::detail::protoify<terminal_type, Domain>()(fusion::at_c<0>(sequence));
- }
             };
 
- template<typename Sequence>
- struct unpack_expr_<tag::terminal, deduce_domain, Sequence, 1u>
- : unpack_expr_<tag::terminal, default_domain, Sequence, 1u>
- {};
+ /// Construct an expression node with tag type \c Tag
+ /// and in the domain \c Domain.
+ ///
+ /// \return <tt>proto::make_expr\<Tag, Domain\>(a0,...aN)</tt>
+ template<typename A0>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , A0 const
+ >::type const
+ operator ()(A0 const &a0) const
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , Domain
+ , A0 const
+ >()(a0);
+ }
 
+ // Additional overloads generated by the preprocessor ...
+ #include <boost/proto/detail/make_expr_funop.hpp>
+
+ /// INTERNAL ONLY
+ ///
             template<
- typename Tag
- , typename Domain
- BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
+ BOOST_PP_ENUM_BINARY_PARAMS(
                     BOOST_PROTO_MAX_ARITY
                   , typename A
                   , = void BOOST_PP_INTERCEPT
                 )
- , typename _ = void
>
- struct make_expr_
- {};
-
- template<typename Domain, typename A>
- struct make_expr_<tag::terminal, Domain, A
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
- {
- typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
-
- result_type operator()(typename add_reference<A>::type a) const
- {
- return proto::detail::protoify<A, Domain>()(a);
- }
- };
-
- template<typename A>
- struct make_expr_<tag::terminal, deduce_domain, A
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
- : make_expr_<tag::terminal, default_domain, A>
+ struct impl
+ : detail::make_expr_<
+ Tag
+ , Domain
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
+ >
             {};
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 1)) \
- /**/
-
- #include BOOST_PP_ITERATE()
- }
-
- namespace result_of
+ /// \brief A callable function object equivalent to the
+ /// \c proto::unpack_expr() function.
+ ///
+ /// In all cases, <tt>functional::unpack_expr\<Tag, Domain\>()(seq)</tt>
+ /// is equivalent to <tt>proto::unpack_expr\<Tag, Domain\>(seq)</tt>.
+ ///
+ /// <tt>functional::unpack_expr\<Tag\>()(seq)</tt>
+ /// is equivalent to <tt>proto::unpack_expr\<Tag\>(seq)</tt>.
+ template<typename Tag, typename Domain /* = deduce_domain*/>
+ struct unpack_expr
         {
- /// \brief Metafunction that computes the return type of the
- /// \c make_expr() function, with a domain deduced from the
- /// domains of the children.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to
- /// compute the return type of the \c make_expr() function.
- ///
- /// In this specialization, the domain is deduced from the
- /// domains of the child types. (If
- /// <tt>is_domain\<A0\>::value</tt> is \c true, then another
- /// specialization is selected.)
- template<
- typename Tag
- , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct make_expr
- {
- /// Same as <tt>result_of::make_expr\<Tag, D, A0, ... AN\>::type</tt>
- /// where \c D is the deduced domain, which is calculated as follows:
- ///
- /// For each \c x in <tt>[0,N)</tt> (proceeding in order beginning with
- /// <tt>x=0</tt>), if <tt>domain_of\<Ax\>::type</tt> is not
- /// \c default_domain, then \c D is <tt>domain_of\<Ax\>::type</tt>.
- /// Otherwise, \c D is \c default_domain.
- typedef
- typename detail::make_expr_<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
-
- /// \brief Metafunction that computes the return type of the
- /// \c make_expr() function, within the specified domain.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
- /// the return type of the \c make_expr() function.
- template<
- typename Tag
- , typename Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
- >
- struct make_expr<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- , typename Domain::proto_is_domain_
- >
- {
- /// If \c Tag is <tt>tag::terminal</tt>, then \c type is a
- /// typedef for <tt>boost::result_of\<Domain(expr\<tag::terminal,
- /// term\<A0\> \>)\>::type</tt>.
- ///
- /// Otherwise, \c type is a typedef for <tt>boost::result_of\<Domain(expr\<Tag,
- /// listN\< as_child\<A0\>::type, ... as_child\<AN\>::type\>)
- /// \>::type</tt>, where \c N is the number of non-void template
- /// arguments, and <tt>as_child\<A\>::type</tt> is evaluated as
- /// follows:
- ///
- /// \li If <tt>is_expr\<A\>::value</tt> is \c true, then the
- /// child type is \c A.
- /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
- /// and <tt>is_expr\<B\>::value</tt> is \c true, then the
- /// child type is <tt>B &</tt>.
- /// \li If <tt>is_expr\<A\>::value</tt> is \c false, then the
- /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<A\> \>
- /// )\>::type</tt>.
- /// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
- /// and <tt>is_expr\<B\>::value</tt> is \c false, then the
- /// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<B &\> \>
- /// )\>::type</tt>.
- typedef
- typename detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >::result_type
- type;
- };
+ BOOST_PROTO_CALLABLE()
 
- /// \brief Metafunction that computes the return type of the
- /// \c unpack_expr() function, with a domain deduced from the
- /// domains of the children.
- ///
- /// Use the <tt>result_of::unpack_expr\<\></tt> metafunction to
- /// compute the return type of the \c unpack_expr() function.
- ///
- /// \c Sequence is a Fusion Forward Sequence.
- ///
- /// In this specialization, the domain is deduced from the
- /// domains of the child types. (If
- /// <tt>is_domain\<Sequence>::value</tt> is \c true, then another
- /// specialization is selected.)
- template<
- typename Tag
- , typename Sequence
- , typename Void1 // = void
- , typename Void2 // = void
- >
- struct unpack_expr
- {
- /// Let \c S be the type of a Fusion Random Access Sequence
- /// equivalent to \c Sequence. Then \c type is the
- /// same as <tt>result_of::make_expr\<Tag,
- /// fusion::result_of::value_at_c\<S, 0\>::type, ...
- /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
- /// where \c N is the size of \c S.
- typedef
- typename detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
- >::type
- type;
- };
+ template<typename Sig>
+ struct result;
 
- /// \brief Metafunction that computes the return type of the
- /// \c unpack_expr() function, within the specified domain.
- ///
- /// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
- /// the return type of the \c make_expr() function.
- template<typename Tag, typename Domain, typename Sequence>
- struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
+ template<typename This, typename Sequence>
+ struct result<This(Sequence)>
             {
- /// Let \c S be the type of a Fusion Random Access Sequence
- /// equivalent to \c Sequence. Then \c type is the
- /// same as <tt>result_of::make_expr\<Tag, Domain,
- /// fusion::result_of::value_at_c\<S, 0\>::type, ...
- /// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
- /// where \c N is the size of \c S.
                 typedef
- typename detail::unpack_expr_<
+ typename result_of::unpack_expr<
                         Tag
                       , Domain
- , Sequence
- , fusion::result_of::size<Sequence>::type::value
+ , typename remove_reference<Sequence>::type
>::type
                 type;
             };
- }
 
- namespace functional
- {
- /// \brief A callable function object equivalent to the
- /// \c proto::make_expr() function.
- ///
- /// In all cases, <tt>functional::make_expr\<Tag, Domain\>()(a0, ... aN)</tt>
- /// is equivalent to <tt>proto::make_expr\<Tag, Domain\>(a0, ... aN)</tt>.
+ /// Construct an expression node with tag type \c Tag
+ /// and in the domain \c Domain.
             ///
- /// <tt>functional::make_expr\<Tag\>()(a0, ... aN)</tt>
- /// is equivalent to <tt>proto::make_expr\<Tag\>(a0, ... aN)</tt>.
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct make_expr
+ /// \param sequence A Fusion Forward Sequence
+ /// \return <tt>proto::unpack_expr\<Tag, Domain\>(sequence)</tt>
+ template<typename Sequence>
+ typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
+ operator ()(Sequence const &sequence) const
             {
- BOOST_PROTO_CALLABLE()
- BOOST_PROTO_POLY_FUNCTION()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename A0>
- struct result<This(A0)>
- {
- typedef
- typename result_of::make_expr<
- Tag
- , Domain
- , A0
- >::type
- type;
- };
-
- /// Construct an expression node with tag type \c Tag
- /// and in the domain \c Domain.
- ///
- /// \return <tt>proto::make_expr\<Tag, Domain\>(a0,...aN)</tt>
- template<typename A0>
- typename result_of::make_expr<
+ return proto::detail::unpack_expr_<
                     Tag
                   , Domain
- , A0 const
- >::type const
- operator ()(A0 const &a0) const
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , A0 const
- >()(a0);
- }
-
- // Additional overloads generated by the preprocessor ...
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 2)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<
- BOOST_PP_ENUM_BINARY_PARAMS(
- BOOST_PROTO_MAX_ARITY
- , typename A
- , = void BOOST_PP_INTERCEPT
- )
- >
- struct impl
- : detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
- >
- {};
- };
-
- /// \brief A callable function object equivalent to the
- /// \c proto::unpack_expr() function.
- ///
- /// In all cases, <tt>functional::unpack_expr\<Tag, Domain\>()(seq)</tt>
- /// is equivalent to <tt>proto::unpack_expr\<Tag, Domain\>(seq)</tt>.
- ///
- /// <tt>functional::unpack_expr\<Tag\>()(seq)</tt>
- /// is equivalent to <tt>proto::unpack_expr\<Tag\>(seq)</tt>.
- template<typename Tag, typename Domain /* = deduce_domain*/>
- struct unpack_expr
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
-
- template<typename This, typename Sequence>
- struct result<This(Sequence)>
- {
- typedef
- typename result_of::unpack_expr<
- Tag
- , Domain
- , typename remove_reference<Sequence>::type
- >::type
- type;
- };
-
- /// Construct an expression node with tag type \c Tag
- /// and in the domain \c Domain.
- ///
- /// \param sequence A Fusion Forward Sequence
- /// \return <tt>proto::unpack_expr\<Tag, Domain\>(sequence)</tt>
- template<typename Sequence>
- typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
- operator ()(Sequence const &sequence) const
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
- };
-
- } // namespace functional
-
- /// \brief Construct an expression of the requested tag type
- /// with a domain and with the specified arguments as children.
- ///
- /// This function template may be invoked either with or without
- /// specifying a \c Domain argument. If no domain is specified,
- /// the domain is deduced by examining in order the domains of
- /// the given arguments and taking the first that is not
- /// \c default_domain, if any such domain exists, or
- /// \c default_domain otherwise.
- ///
- /// Let \c wrap_(x) be defined such that:
- /// \li If \c x is a <tt>boost::reference_wrapper\<\></tt>,
- /// \c wrap_(x) is equivalent to <tt>as_child\<Domain\>(x.get())</tt>.
- /// \li Otherwise, \c wrap_(x) is equivalent to
- /// <tt>as_expr\<Domain\>(x)</tt>.
- ///
- /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
- /// <tt>expr\<Tag, listN\<C0,...CN\> \>::make(c0,...cN)</tt>
- /// where \c Bx is the type of \c bx.
- ///
- /// \return <tt>Domain()(make_\<Tag\>(wrap_(a0),...wrap_(aN)))</tt>.
- template<typename Tag, typename A0>
- typename lazy_disable_if<
- is_domain<A0>
- , result_of::make_expr<
- Tag
- , A0 const
- >
- >::type const
- make_expr(A0 const &a0)
- {
- return proto::detail::make_expr_<
- Tag
- , deduce_domain
- , A0 const
- >()(a0);
- }
-
- /// \overload
- ///
- template<typename Tag, typename Domain, typename C0>
- typename result_of::make_expr<
- Tag
- , Domain
- , C0 const
- >::type const
- make_expr(C0 const &c0)
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- , C0 const
- >()(c0);
- }
-
- // Additional overloads generated by the preprocessor...
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 3)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
- /// \brief Construct an expression of the requested tag type
- /// with a domain and with childres from the specified Fusion
- /// Forward Sequence.
- ///
- /// This function template may be invoked either with or without
- /// specifying a \c Domain argument. If no domain is specified,
- /// the domain is deduced by examining in order the domains of the
- /// elements of \c sequence and taking the first that is not
- /// \c default_domain, if any such domain exists, or
- /// \c default_domain otherwise.
- ///
- /// Let \c s be a Fusion Random Access Sequence equivalent to \c sequence.
- /// Let <tt>wrap_\<N\>(s)</tt>, where \c s has type \c S, be defined
- /// such that:
- /// \li If <tt>fusion::result_of::value_at_c\<S,N\>::type</tt> is a reference,
- /// <tt>wrap_\<N\>(s)</tt> is equivalent to
- /// <tt>as_child\<Domain\>(fusion::at_c\<N\>(s))</tt>.
- /// \li Otherwise, <tt>wrap_\<N\>(s)</tt> is equivalent to
- /// <tt>as_expr\<Domain\>(fusion::at_c\<N\>(s))</tt>.
- ///
- /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
- /// <tt>expr\<Tag, listN\<B0,...BN\> \>::make(b0,...bN)</tt>
- /// where \c Bx is the type of \c bx.
- ///
- /// \param sequence a Fusion Forward Sequence.
- /// \return <tt>Domain()(make_\<Tag\>(wrap_\<0\>(s),...wrap_\<N-1\>(s)))</tt>,
- /// where N is the size of \c Sequence.
- template<typename Tag, typename Sequence>
- typename lazy_disable_if<
- is_domain<Sequence>
- , result_of::unpack_expr<Tag, Sequence const>
- >::type const
- unpack_expr(Sequence const &sequence)
- {
- return proto::detail::unpack_expr_<
- Tag
- , deduce_domain
- , Sequence const
- , fusion::result_of::size<Sequence>::type::value
- >::call(sequence);
- }
-
- /// \overload
- ///
- template<typename Tag, typename Domain, typename Sequence2>
- typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
- unpack_expr(Sequence2 const &sequence2)
- {
- return proto::detail::unpack_expr_<
- Tag
- , Domain
- , Sequence2 const
- , fusion::result_of::size<Sequence2>::type::value
- >::call(sequence2);
- }
-
- /// INTERNAL ONLY
- ///
- template<typename Tag, typename Domain>
- struct is_callable<functional::make_expr<Tag, Domain> >
- : mpl::true_
- {};
-
- /// INTERNAL ONLY
- ///
- template<typename Tag, typename Domain>
- struct is_callable<functional::unpack_expr<Tag, Domain> >
- : mpl::true_
- {};
-
- }}
-
- #ifdef _MSC_VER
- # pragma warning(pop)
- #endif
-
- #undef BOOST_PROTO_FUSION_AT
- #undef BOOST_PROTO_FUSION_AT_TYPE
- #undef BOOST_PROTO_FUSION_AS_CHILD_AT
- #undef BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE
- #undef BOOST_PROTO_FUSION_NEXT_ITERATOR
- #undef BOOST_PROTO_FUSION_NEXT_ITERATOR_TYPE
- #undef BOOST_PROTO_FUSION_ITERATORS
- #undef BOOST_PROTO_FUSION_ITERATORS_TYPE
-
- #endif // BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
-
-#elif BOOST_PP_ITERATION_FLAGS() == 1
-
- #define N BOOST_PP_ITERATION()
- #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
-
- template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
- {
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain))
- >
- proto_args;
-
- typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
- typedef typename Domain::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
-
- result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
- {
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
- };
- return proto_generator()(that);
- }
- };
-
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
- : make_expr_<
- Tag
- , typename BOOST_PP_CAT(deduce_domain, N)<BOOST_PP_ENUM_PARAMS(N, A)>::type
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- >
- {};
-
- template<typename Tag, typename Domain, typename Sequence>
- struct unpack_expr_<Tag, Domain, Sequence, N>
- {
- BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
-
- typedef
- BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE, ~)
- >
- proto_args;
-
- typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
- typedef typename Domain::proto_generator proto_generator;
- typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
-
- static type const call(Sequence const &sequence)
- {
- BOOST_PROTO_FUSION_ITERATORS(N)
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT, ~)
- };
- return proto_generator()(that);
- }
- };
-
- template<typename Tag, typename Sequence>
- struct unpack_expr_<Tag, deduce_domain, Sequence, N>
- {
- BOOST_PROTO_FUSION_ITERATORS_TYPE(N)
-
- typedef
- unpack_expr_<
- Tag
- , typename BOOST_PP_CAT(deduce_domain, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AT_TYPE, ~)
- >::type
- , Sequence
- , N
- >
- other;
-
- typedef typename other::type type;
-
- static type const call(Sequence const &sequence)
- {
- return other::call(sequence);
+ , Sequence const
+ , fusion::result_of::size<Sequence>::type::value
+ >::call(sequence);
             }
         };
 
- #undef N
- #undef M
-
-#elif BOOST_PP_ITERATION_FLAGS() == 2
+ } // namespace functional
 
- #define N BOOST_PP_ITERATION()
-
- template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
- {
- typedef
- typename result_of::make_expr<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- >::type
- type;
- };
+ /// \brief Construct an expression of the requested tag type
+ /// with a domain and with the specified arguments as children.
+ ///
+ /// This function template may be invoked either with or without
+ /// specifying a \c Domain argument. If no domain is specified,
+ /// the domain is deduced by examining in order the domains of
+ /// the given arguments and taking the first that is not
+ /// \c default_domain, if any such domain exists, or
+ /// \c default_domain otherwise.
+ ///
+ /// Let \c wrap_(x) be defined such that:
+ /// \li If \c x is a <tt>boost::reference_wrapper\<\></tt>,
+ /// \c wrap_(x) is equivalent to <tt>as_child\<Domain\>(x.get())</tt>.
+ /// \li Otherwise, \c wrap_(x) is equivalent to
+ /// <tt>as_expr\<Domain\>(x)</tt>.
+ ///
+ /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
+ /// <tt>expr\<Tag, listN\<C0,...CN\> \>::make(c0,...cN)</tt>
+ /// where \c Bx is the type of \c bx.
+ ///
+ /// \return <tt>Domain()(make_\<Tag\>(wrap_(a0),...wrap_(aN)))</tt>.
+ template<typename Tag, typename A0>
+ typename lazy_disable_if<
+ is_domain<A0>
+ , result_of::make_expr<
+ Tag
+ , A0 const
+ >
+ >::type const
+ make_expr(A0 const &a0)
+ {
+ return proto::detail::make_expr_<
+ Tag
+ , deduce_domain
+ , A0 const
+ >()(a0);
+ }
 
- /// \overload
- ///
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result_of::make_expr<
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename C0>
+ typename result_of::make_expr<
+ Tag
+ , Domain
+ , C0 const
+ >::type const
+ make_expr(C0 const &c0)
+ {
+ return proto::detail::make_expr_<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >::type const
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >()(BOOST_PP_ENUM_PARAMS(N, a));
- }
-
- #undef N
-
-#elif BOOST_PP_ITERATION_FLAGS() == 3
+ , C0 const
+ >()(c0);
+ }
 
- #define N BOOST_PP_ITERATION()
+ // Additional overloads generated by the preprocessor...
+ #include <boost/proto/detail/make_expr.hpp>
 
- /// \overload
- ///
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- typename lazy_disable_if<
- is_domain<A0>
- , result_of::make_expr<
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >
- >::type const
- make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a))
- {
- return proto::detail::make_expr_<
- Tag
- , deduce_domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
- >()(BOOST_PP_ENUM_PARAMS(N, a));
- }
+ /// \brief Construct an expression of the requested tag type
+ /// with a domain and with childres from the specified Fusion
+ /// Forward Sequence.
+ ///
+ /// This function template may be invoked either with or without
+ /// specifying a \c Domain argument. If no domain is specified,
+ /// the domain is deduced by examining in order the domains of the
+ /// elements of \c sequence and taking the first that is not
+ /// \c default_domain, if any such domain exists, or
+ /// \c default_domain otherwise.
+ ///
+ /// Let \c s be a Fusion Random Access Sequence equivalent to \c sequence.
+ /// Let <tt>wrap_\<N\>(s)</tt>, where \c s has type \c S, be defined
+ /// such that:
+ /// \li If <tt>fusion::result_of::value_at_c\<S,N\>::type</tt> is a reference,
+ /// <tt>wrap_\<N\>(s)</tt> is equivalent to
+ /// <tt>as_child\<Domain\>(fusion::at_c\<N\>(s))</tt>.
+ /// \li Otherwise, <tt>wrap_\<N\>(s)</tt> is equivalent to
+ /// <tt>as_expr\<Domain\>(fusion::at_c\<N\>(s))</tt>.
+ ///
+ /// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
+ /// <tt>expr\<Tag, listN\<B0,...BN\> \>::make(b0,...bN)</tt>
+ /// where \c Bx is the type of \c bx.
+ ///
+ /// \param sequence a Fusion Forward Sequence.
+ /// \return <tt>Domain()(make_\<Tag\>(wrap_\<0\>(s),...wrap_\<N-1\>(s)))</tt>,
+ /// where N is the size of \c Sequence.
+ template<typename Tag, typename Sequence>
+ typename lazy_disable_if<
+ is_domain<Sequence>
+ , result_of::unpack_expr<Tag, Sequence const>
+ >::type const
+ unpack_expr(Sequence const &sequence)
+ {
+ return proto::detail::unpack_expr_<
+ Tag
+ , deduce_domain
+ , Sequence const
+ , fusion::result_of::size<Sequence>::type::value
+ >::call(sequence);
+ }
 
- /// \overload
- ///
- template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename C)>
- typename result_of::make_expr<
+ /// \overload
+ ///
+ template<typename Tag, typename Domain, typename Sequence2>
+ typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
+ unpack_expr(Sequence2 const &sequence2)
+ {
+ return proto::detail::unpack_expr_<
             Tag
           , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
- >::type const
- make_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, const C, &c))
- {
- return proto::detail::make_expr_<
- Tag
- , Domain
- BOOST_PP_ENUM_TRAILING_PARAMS(N, const C)
- >()(BOOST_PP_ENUM_PARAMS(N, c));
- }
+ , Sequence2 const
+ , fusion::result_of::size<Sequence2>::type::value
+ >::call(sequence2);
+ }
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Tag, typename Domain>
+ struct is_callable<functional::make_expr<Tag, Domain> >
+ : mpl::true_
+ {};
 
- #undef N
+ /// INTERNAL ONLY
+ ///
+ template<typename Tag, typename Domain>
+ struct is_callable<functional::unpack_expr<Tag, Domain> >
+ : mpl::true_
+ {};
+
+}}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
-#endif // BOOST_PP_IS_ITERATING
+#endif // BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005

Modified: trunk/libs/proto/preprocess/preprocess_proto.cpp
==============================================================================
--- trunk/libs/proto/preprocess/preprocess_proto.cpp (original)
+++ trunk/libs/proto/preprocess/preprocess_proto.cpp 2011-05-06 05:03:40 EDT (Fri, 06 May 2011)
@@ -13,3 +13,5 @@
 #include <boost/proto/expr.hpp>
 #include <boost/proto/extends.hpp>
 #include <boost/proto/deep_copy.hpp>
+#include <boost/proto/generate.hpp>
+#include <boost/proto/make_expr.hpp>


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