Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71783 - in trunk: boost/proto/detail boost/proto/detail/preprocessed boost/proto/transform boost/proto/transform/detail boost/proto/transform/detail/preprocessed libs/proto/preprocess
From: eric_at_[hidden]
Date: 2011-05-07 13:34:12


Author: eric_niebler
Date: 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
New Revision: 71783
URL: http://svn.boost.org/trac/boost/changeset/71783

Log:
pre-preprocess call.hpp, use new wave feature to simplify pre-preprocessing
Added:
   trunk/boost/proto/transform/detail/
   trunk/boost/proto/transform/detail/call.hpp (contents, props changed)
   trunk/boost/proto/transform/detail/preprocessed/
   trunk/boost/proto/transform/detail/preprocessed/call.hpp (contents, props changed)
Text files modified:
   trunk/boost/proto/detail/preprocessed/traits.hpp | 36 +-
   trunk/boost/proto/detail/template_arity.hpp | 21
   trunk/boost/proto/detail/traits.hpp | 12
   trunk/boost/proto/transform/call.hpp | 709 ++++++++++++++++++---------------------
   trunk/libs/proto/preprocess/preprocess_proto.cpp | 1
   trunk/libs/proto/preprocess/wave.cfg | 2
   6 files changed, 356 insertions(+), 425 deletions(-)

Modified: trunk/boost/proto/detail/preprocessed/traits.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/traits.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/traits.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -17,7 +17,7 @@
             struct child_c<Expr, 0>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child0 value_type;
@@ -32,7 +32,7 @@
             struct child_c<Expr &, 0>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child0 value_type;
@@ -53,7 +53,7 @@
             struct child_c<Expr const &, 0>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child0 value_type;
@@ -157,7 +157,7 @@
             struct child_c<Expr, 1>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child1 value_type;
@@ -172,7 +172,7 @@
             struct child_c<Expr &, 1>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child1 value_type;
@@ -193,7 +193,7 @@
             struct child_c<Expr const &, 1>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child1 value_type;
@@ -297,7 +297,7 @@
             struct child_c<Expr, 2>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child2 value_type;
@@ -312,7 +312,7 @@
             struct child_c<Expr &, 2>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child2 value_type;
@@ -333,7 +333,7 @@
             struct child_c<Expr const &, 2>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child2 value_type;
@@ -437,7 +437,7 @@
             struct child_c<Expr, 3>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child3 value_type;
@@ -452,7 +452,7 @@
             struct child_c<Expr &, 3>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child3 value_type;
@@ -473,7 +473,7 @@
             struct child_c<Expr const &, 3>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child3 value_type;
@@ -577,7 +577,7 @@
             struct child_c<Expr, 4>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child4 value_type;
@@ -592,7 +592,7 @@
             struct child_c<Expr &, 4>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child4 value_type;
@@ -613,7 +613,7 @@
             struct child_c<Expr const &, 4>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child4 value_type;
@@ -708,7 +708,7 @@
             struct child_c<Expr, 5>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child5 value_type;
@@ -723,7 +723,7 @@
             struct child_c<Expr &, 5>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child5 value_type;
@@ -744,7 +744,7 @@
             struct child_c<Expr const &, 5>
             {
                 
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
                 
                 
                 typedef typename Expr::proto_child5 value_type;

Modified: trunk/boost/proto/detail/template_arity.hpp
==============================================================================
--- trunk/boost/proto/detail/template_arity.hpp (original)
+++ trunk/boost/proto/detail/template_arity.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -13,6 +13,12 @@
     #ifndef BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
     #define BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
 
+ // Somewhat indirect definition of BOOST_PROTO_TEMPLATE_ARITY_PARAM is
+ // to overcome a shortcoming of the Wave tool used to generate the
+ // pre-preprocessed headers.
+ #define BOOST_PROTO_TEMPLATE_ARITY_PARAM BOOST_PROTO_TEMPLATE_ARITY_PARAM2
+ #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param)
+
     #ifdef BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
 
         #include <boost/preprocessor/cat.hpp>
@@ -22,11 +28,8 @@
         #include <boost/mpl/int.hpp>
         #include <boost/proto/proto_fwd.hpp>
 
- // When generating the preprocessed headers, leave this workaround in by
- // simply not defining it.
- #if !defined(__WAVE__) || !defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
- #define BOOST_PROTO_TEMPLATE_ARITY_PARAM(param) , param
- #endif
+ #undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2
+ #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param
 
         namespace boost { namespace proto { namespace detail
         {
@@ -62,14 +65,6 @@
 
         }}}
 
- #else
-
- // When generating the preprocessed headers, leave this workaround in by
- // simply not defining it.
- #if !defined(__WAVE__) || !defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
- #define BOOST_PROTO_TEMPLATE_ARITY_PARAM(param)
- #endif
-
     #endif // BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
     #endif // BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
 

Modified: trunk/boost/proto/detail/traits.hpp
==============================================================================
--- trunk/boost/proto/detail/traits.hpp (original)
+++ trunk/boost/proto/detail/traits.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -1,8 +1,6 @@
 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
 
- #define BOOST_PROTO_STATIC_ASSERT BOOST_STATIC_ASSERT
     #include <boost/proto/detail/preprocessed/traits.hpp>
- #undef BOOST_PROTO_STATIC_ASSERT
 
 #elif !defined(BOOST_PP_IS_ITERATING)
 
@@ -13,8 +11,6 @@
 
     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
         #pragma wave option(preserve: 2, line: 0, output: "preprocessed/traits.hpp")
- #else
- #define BOOST_PROTO_STATIC_ASSERT BOOST_STATIC_ASSERT
     #endif
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -35,8 +31,6 @@
 
     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
         #pragma wave option(output: null)
- #else
- #undef BOOST_PROTO_STATIC_ASSERT
     #endif
 
     #undef BOOST_PROTO_CHILD
@@ -155,7 +149,7 @@
             struct child_c<Expr, N>
             {
                 /// Verify that we are not operating on a terminal
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
 
                 /// The raw type of the Nth child as it is stored within
                 /// \c Expr. This may be a value or a reference
@@ -173,7 +167,7 @@
             struct child_c<Expr &, N>
             {
                 /// Verify that we are not operating on a terminal
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
 
                 /// The raw type of the Nth child as it is stored within
                 /// \c Expr. This may be a value or a reference
@@ -198,7 +192,7 @@
             struct child_c<Expr const &, N>
             {
                 /// Verify that we are not operating on a terminal
- BOOST_PROTO_STATIC_ASSERT(0 != Expr::proto_arity_c);
+ BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
 
                 /// The raw type of the Nth child as it is stored within
                 /// \c Expr. This may be a value or a reference

Modified: trunk/boost/proto/transform/call.hpp
==============================================================================
--- trunk/boost/proto/transform/call.hpp (original)
+++ trunk/boost/proto/transform/call.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -1,416 +1,355 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file call.hpp
- /// Contains definition of the call<> transform.
- //
- // 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_TRANSFORM_CALL_HPP_EAN_11_02_2007
- #define BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/repetition/repeat.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/ref.hpp>
- #include <boost/utility/result_of.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/impl.hpp>
- #include <boost/proto/detail/as_lvalue.hpp>
- #include <boost/proto/detail/poly_function.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file call.hpp
+/// Contains definition of the call<> transform.
+//
+// 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_TRANSFORM_CALL_HPP_EAN_11_02_2007
+#define BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/ref.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/detail/as_lvalue.hpp>
+#include <boost/proto/detail/poly_function.hpp>
+
+namespace boost { namespace proto
+{
+ /// \brief Wrap \c PrimitiveTransform so that <tt>when\<\></tt> knows
+ /// it is callable. Requires that the parameter is actually a
+ /// PrimitiveTransform.
+ ///
+ /// This form of <tt>call\<\></tt> is useful for annotating an
+ /// arbitrary PrimitiveTransform as callable when using it with
+ /// <tt>when\<\></tt>. Consider the following transform, which
+ /// is parameterized with another transform.
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , Grammar(_child) // May or may not work.
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The problem with the above is that <tt>when\<\></tt> may or
+ /// may not recognize \c Grammar as callable, depending on how
+ /// \c Grammar is implemented. (See <tt>is_callable\<\></tt> for
+ /// a discussion of this issue.) You can guard against
+ /// the issue by wrapping \c Grammar in <tt>call\<\></tt>, such
+ /// as:
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , call<Grammar>(_child) // OK, this works
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The above could also have been written as:
+ ///
+ /// \code
+ /// template<typename Grammar>
+ /// struct Foo
+ /// : when<
+ /// unary_plus<Grammar>
+ /// , call<Grammar(_child)> // OK, this works, too
+ /// >
+ /// {};
+ /// \endcode
+ template<typename PrimitiveTransform>
+ struct call
+ : PrimitiveTransform
+ {};
+
+ /// \brief Either call the PolymorphicFunctionObject with 0
+ /// arguments, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun>
+ struct call<Fun()> : transform<call<Fun()> >
     {
- /// \brief Wrap \c PrimitiveTransform so that <tt>when\<\></tt> knows
- /// it is callable. Requires that the parameter is actually a
- /// PrimitiveTransform.
- ///
- /// This form of <tt>call\<\></tt> is useful for annotating an
- /// arbitrary PrimitiveTransform as callable when using it with
- /// <tt>when\<\></tt>. Consider the following transform, which
- /// is parameterized with another transform.
- ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , Grammar(_child) // May or may not work.
- /// >
- /// {};
- /// \endcode
- ///
- /// The problem with the above is that <tt>when\<\></tt> may or
- /// may not recognize \c Grammar as callable, depending on how
- /// \c Grammar is implemented. (See <tt>is_callable\<\></tt> for
- /// a discussion of this issue.) You can guard against
- /// the issue by wrapping \c Grammar in <tt>call\<\></tt>, such
- /// as:
- ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , call<Grammar>(_child) // OK, this works
- /// >
- /// {};
- /// \endcode
+ /// INTERNAL ONLY
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename BOOST_PROTO_RESULT_OF<Fun()>::type result_type;
+
+ result_type operator()(
+ typename impl2::expr_param
+ , typename impl2::state_param
+ , typename impl2::data_param
+ ) const
+ {
+ return Fun()();
+ }
+ };
+
+ /// INTERNAL ONLY
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : Fun::template impl<Expr, State, Data>
+ {};
+
+ /// Either call the PolymorphicFunctionObject \c Fun with 0 arguments; or
+ /// invoke the PrimitiveTransform \c Fun with 3 arguments: the current
+ /// expression, state, and data.
         ///
- /// The above could also have been written as:
+ /// If \c Fun is a nullary PolymorphicFunctionObject, return <tt>Fun()()</tt>.
+ /// Otherwise, return <tt>Fun()(e, s, d)</tt>.
         ///
- /// \code
- /// template<typename Grammar>
- /// struct Foo
- /// : when<
- /// unary_plus<Grammar>
- /// , call<Grammar(_child)> // OK, this works, too
- /// >
- /// {};
- /// \endcode
- template<typename PrimitiveTransform>
- struct call
- : PrimitiveTransform
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+
+ /// If \c Fun is a nullary PolymorphicFunctionObject, \c type is a typedef
+ /// for <tt>boost::result_of\<Fun()\>::type</tt>. Otherwise, it is
+ /// a typedef for <tt>boost::result_of\<Fun(Expr, State, Data)\>::type</tt>.
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
         {};
+ };
 
- /// \brief Either call the PolymorphicFunctionObject with 0
- /// arguments, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun>
- struct call<Fun()> : transform<call<Fun()> >
+ /// \brief Either call the PolymorphicFunctionObject with 1
+ /// argument, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun, typename A0>
+ struct call<Fun(A0)> : transform<call<Fun(A0)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
         {
- /// INTERNAL ONLY
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename BOOST_PROTO_RESULT_OF<Fun()>::type result_type;
-
- result_type operator()(
- typename impl2::expr_param
- , typename impl2::state_param
- , typename impl2::data_param
- ) const
- {
- return Fun()();
- }
- };
-
- /// INTERNAL ONLY
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : Fun::template impl<Expr, State, Data>
- {};
-
- /// Either call the PolymorphicFunctionObject \c Fun with 0 arguments; or
- /// invoke the PrimitiveTransform \c Fun with 3 arguments: the current
- /// expression, state, and data.
- ///
- /// If \c Fun is a nullary PolymorphicFunctionObject, return <tt>Fun()()</tt>.
- /// Otherwise, return <tt>Fun()(e, s, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
-
- /// If \c Fun is a nullary PolymorphicFunctionObject, \c type is a typedef
- /// for <tt>boost::result_of\<Fun()\>::type</tt>. Otherwise, it is
- /// a typedef for <tt>boost::result_of\<Fun(Expr, State, Data)\>::type</tt>.
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename detail::poly_function_traits<Fun, Fun(a0)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
         };
 
- /// \brief Either call the PolymorphicFunctionObject with 1
- /// argument, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun, typename A0>
- struct call<Fun(A0)> : transform<call<Fun(A0)> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename detail::poly_function_traits<Fun, Fun(a0)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename Fun::template impl<a0, State, Data>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename Fun::template impl<a0, State, Data>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, State, Data>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , s
- , d
- );
- }
- };
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
- /// be the type of \c x.
- /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
- /// then \c type is a typedef for <tt>boost::result_of\<Fun(X)\>::type</tt>.
- /// Otherwise, it is a typedef for <tt>boost::result_of\<Fun(X, State, Data)\>::type</tt>.
-
- /// Either call the PolymorphicFunctionObject with 1 argument:
- /// the result of applying the \c A0 transform; or
- /// invoke the PrimitiveTransform with 3 arguments:
- /// result of applying the \c A0 transform, the state, and the
- /// data.
- ///
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
- /// then return <tt>Fun()(x)</tt>. Otherwise, return
- /// <tt>Fun()(x, s, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename Fun::template impl<a0, State, Data>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , s
+ , d
+ );
+ }
         };
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
+ /// be the type of \c x.
+ /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
+ /// then \c type is a typedef for <tt>boost::result_of\<Fun(X)\>::type</tt>.
+ /// Otherwise, it is a typedef for <tt>boost::result_of\<Fun(X, State, Data)\>::type</tt>.
+
+ /// Either call the PolymorphicFunctionObject with 1 argument:
+ /// the result of applying the \c A0 transform; or
+ /// invoke the PrimitiveTransform with 3 arguments:
+ /// result of applying the \c A0 transform, the state, and the
+ /// data.
+ ///
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// If \c Fun is a unary PolymorphicFunctionObject that accepts \c x,
+ /// then return <tt>Fun()(x)</tt>. Otherwise, return
+ /// <tt>Fun()(x, s, d)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
+ {};
+ };
 
- /// \brief Either call the PolymorphicFunctionObject with 2
- /// arguments, or invoke the PrimitiveTransform with 3
- /// arguments.
- template<typename Fun, typename A0, typename A1>
- struct call<Fun(A0, A1)> : transform<call<Fun(A0, A1)> >
+ /// \brief Either call the PolymorphicFunctionObject with 2
+ /// arguments, or invoke the PrimitiveTransform with 3
+ /// arguments.
+ template<typename Fun, typename A0, typename A1>
+ struct call<Fun(A0, A1)> : transform<call<Fun(A0, A1)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename detail::poly_function_traits<Fun, Fun(a0, a1)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0, a1)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0, a1)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename Fun::template impl<a0, a1, Data>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, a1, Data>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
- , d
- );
- }
- };
-
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
- /// be the type of \c x.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt> and \c Y
- /// be the type of \c y.
- /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
- /// and \c y, then \c type is a typedef for
- /// <tt>boost::result_of\<Fun(X, Y)\>::type</tt>. Otherwise, it is
- /// a typedef for <tt>boost::result_of\<Fun(X, Y, Data)\>::type</tt>.
-
- /// Either call the PolymorphicFunctionObject with 2 arguments:
- /// the result of applying the \c A0 transform, and the
- /// result of applying the \c A1 transform; or invoke the
- /// PrimitiveTransform with 3 arguments: the result of applying
- /// the \c A0 transform, the result of applying the \c A1
- /// transform, and the data.
- ///
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
- /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
- /// and \c y, return <tt>Fun()(x, y)</tt>. Otherwise, return
- /// <tt>Fun()(x, y, d)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename detail::poly_function_traits<Fun, Fun(a0, a1)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
         };
 
- /// \brief Call the PolymorphicFunctionObject or the
- /// PrimitiveTransform with the current expression, state
- /// and data, transformed according to \c A0, \c A1, and
- /// \c A2, respectively.
- template<typename Fun, typename A0, typename A1, typename A2>
- struct call<Fun(A0, A1, A2)> : transform<call<Fun(A0, A1, A2)> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data, bool B>
- struct impl2
- : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename Fun::template impl<a0, a1, Data>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
- typedef typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::function_type()(
- detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
- , detail::as_lvalue(typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d))
- );
- }
- };
-
- template<typename Expr, typename State, typename Data>
- struct impl2<Expr, State, Data, true>
- : transform_impl<Expr, State, Data>
- {
- typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
- typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
- typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
- typedef typename Fun::template impl<a0, a1, a2>::result_type result_type;
- result_type operator ()(
- typename impl2::expr_param e
- , typename impl2::state_param s
- , typename impl2::data_param d
- ) const
- {
- return typename Fun::template impl<a0, a1, a2>()(
- typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
- , typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d)
- );
- }
- };
-
- /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
- /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
- /// Let \c z be <tt>when\<_, A2\>()(e, s, d)</tt>.
- /// Return <tt>Fun()(x, y, z)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : impl2<Expr, State, Data, is_transform<Fun>::value>
- {};
+ return typename Fun::template impl<a0, a1, Data>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
+ , d
+ );
+ }
         };
 
- #if BOOST_PROTO_MAX_ARITY > 3
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (4, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/call.hpp>))
- #include BOOST_PP_ITERATE()
- #endif
-
- /// INTERNAL ONLY
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt> and \c X
+ /// be the type of \c x.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt> and \c Y
+ /// be the type of \c y.
+ /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
+ /// and \c y, then \c type is a typedef for
+ /// <tt>boost::result_of\<Fun(X, Y)\>::type</tt>. Otherwise, it is
+ /// a typedef for <tt>boost::result_of\<Fun(X, Y, Data)\>::type</tt>.
+
+ /// Either call the PolymorphicFunctionObject with 2 arguments:
+ /// the result of applying the \c A0 transform, and the
+ /// result of applying the \c A1 transform; or invoke the
+ /// PrimitiveTransform with 3 arguments: the result of applying
+ /// the \c A0 transform, the result of applying the \c A1
+ /// transform, and the data.
         ///
- template<typename Fun>
- struct is_callable<call<Fun> >
- : mpl::true_
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
+ /// If \c Fun is a binary PolymorphicFunction object that accepts \c x
+ /// and \c y, return <tt>Fun()(x, y)</tt>. Otherwise, return
+ /// <tt>Fun()(x, y, d)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
         {};
+ };
 
- }} // namespace boost::proto
-
- #endif
-
-#else
-
- #define N BOOST_PP_ITERATION()
+ /// \brief Call the PolymorphicFunctionObject or the
+ /// PrimitiveTransform with the current expression, state
+ /// and data, transformed according to \c A0, \c A1, and
+ /// \c A2, respectively.
+ template<typename Fun, typename A0, typename A1, typename A2>
+ struct call<Fun(A0, A1, A2)> : transform<call<Fun(A0, A1, A2)> >
+ {
+ template<typename Expr, typename State, typename Data, bool B>
+ struct impl2
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
+ typedef typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
+ {
+ return typename detail::poly_function_traits<Fun, Fun(a0, a1, a2)>::function_type()(
+ detail::as_lvalue(typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d))
+ , detail::as_lvalue(typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d))
+ );
+ }
+ };
 
- /// \brief Call the PolymorphicFunctionObject \c Fun with the
- /// current expression, state and data, transformed according
- /// to \c A0 through \c AN.
- template<typename Fun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> : transform<call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> >
+ template<typename Expr, typename State, typename Data>
+ struct impl2<Expr, State, Data, true>
+ : transform_impl<Expr, State, Data>
         {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ typedef typename when<_, A0>::template impl<Expr, State, Data>::result_type a0;
+ typedef typename when<_, A1>::template impl<Expr, State, Data>::result_type a1;
+ typedef typename when<_, A2>::template impl<Expr, State, Data>::result_type a2;
+ typedef typename Fun::template impl<a0, a1, a2>::result_type result_type;
+ result_type operator ()(
+ typename impl2::expr_param e
+ , typename impl2::state_param s
+ , typename impl2::data_param d
+ ) const
             {
- #define M0(Z, M, DATA) \
- typedef \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data> \
- ::result_type \
- BOOST_PP_CAT(a, M); \
- /**/
- BOOST_PP_REPEAT(N, M0, ~)
- #undef M0
-
- typedef
- typename detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, a))>::result_type
- result_type;
-
- /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
- /// for each \c x in <tt>[0,N]</tt>.
- /// Return <tt>Fun()(a0, a1,... aN)</tt>.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- #define M0(Z, M, DATA) \
- detail::as_lvalue( \
- typename when<_, BOOST_PP_CAT(A, M)> \
- ::template impl<Expr, State, Data>()(e, s, d)) \
- /**/
- return typename detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, a))>::function_type()(
- BOOST_PP_ENUM(N, M0, ~)
- );
- #undef M0
- }
- };
+ return typename Fun::template impl<a0, a1, a2>()(
+ typename when<_, A0>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A1>::template impl<Expr, State, Data>()(e, s, d)
+ , typename when<_, A2>::template impl<Expr, State, Data>()(e, s, d)
+ );
+ }
         };
 
- #undef N
+ /// Let \c x be <tt>when\<_, A0\>()(e, s, d)</tt>.
+ /// Let \c y be <tt>when\<_, A1\>()(e, s, d)</tt>.
+ /// Let \c z be <tt>when\<_, A2\>()(e, s, d)</tt>.
+ /// Return <tt>Fun()(x, y, z)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : impl2<Expr, State, Data, is_transform<Fun>::value>
+ {};
+ };
+
+ #include <boost/proto/transform/detail/call.hpp>
+
+ /// INTERNAL ONLY
+ ///
+ template<typename Fun>
+ struct is_callable<call<Fun> >
+ : mpl::true_
+ {};
+
+}} // namespace boost::proto
 
 #endif

Added: trunk/boost/proto/transform/detail/call.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/call.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -0,0 +1,86 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/call.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_NTH_RESULT_TYPE(Z, M, DATA) \
+ typedef \
+ typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data> \
+ BOOST_PP_CAT(a, M); \
+ typedef typename BOOST_PP_CAT(a, M)::result_type BOOST_PP_CAT(b, M); \
+ /**/
+
+ #define BOOST_PROTO_NTH_RESULT(Z, M, DATA) \
+ detail::as_lvalue(BOOST_PP_CAT(a, M)()(e, s, d)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/call.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file call.hpp
+ /// Contains definition of the call<> transform.
+ //
+ // 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
+
+ #if BOOST_PROTO_MAX_ARITY > 3
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (4, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/call.hpp>))
+ #include BOOST_PP_ITERATE()
+ #endif
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_NTH_RESULT
+ #undef BOOST_PROTO_NTH_RESULT_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief Call the PolymorphicFunctionObject \c Fun with the
+ /// current expression, state and data, transformed according
+ /// to \c A0 through \c AN.
+ template<typename Fun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> : transform<call<Fun(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ BOOST_PP_REPEAT(N, BOOST_PROTO_NTH_RESULT_TYPE, ~)
+
+ typedef detail::poly_function_traits<Fun, Fun(BOOST_PP_ENUM_PARAMS(N, b))> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+ /// Let \c ax be <tt>when\<_, Ax\>()(e, s, d)</tt>
+ /// for each \c x in <tt>[0,N]</tt>.
+ /// Return <tt>Fun()(a0, a1,... aN)</tt>.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(BOOST_PP_ENUM(N, BOOST_PROTO_NTH_RESULT, ~));
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Added: trunk/boost/proto/transform/detail/preprocessed/call.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/preprocessed/call.hpp 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file call.hpp
+ /// Contains definition of the call<> transform.
+ //
+ // 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 Fun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct call<Fun(A0 , A1 , A2 , A3)> : transform<call<Fun(A0 , A1 , A2 , A3)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)));
+ }
+ };
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4;
+ typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4)> function_traits;
+ typedef typename function_traits::result_type result_type;
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ typedef typename function_traits::function_type function_type;
+ return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)));
+ }
+ };
+ };

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-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -16,3 +16,4 @@
 #include <boost/proto/generate.hpp>
 #include <boost/proto/make_expr.hpp>
 #include <boost/proto/matches.hpp>
+#include <boost/proto/transform/call.hpp>

Modified: trunk/libs/proto/preprocess/wave.cfg
==============================================================================
--- trunk/libs/proto/preprocess/wave.cfg (original)
+++ trunk/libs/proto/preprocess/wave.cfg 2011-05-07 13:34:11 EDT (Sat, 07 May 2011)
@@ -1,6 +1,8 @@
 -DBOOST_PROTO_DONT_USE_PREPROCESSED_FILES
 -DBOOST_PROTO_CREATE_PREPROCESSED_FILES
 -D_WIN32
+-NBOOST_STATIC_ASSERT
+-NBOOST_PROTO_TEMPLATE_ARITY_PARAM
 -SC:\boost\org\trunk
 -S"C:\Program Files\Microsoft Visual Studio 10.0\VC\include"
 -S.


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