Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71832 - in trunk: boost/proto 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-08 13:57:01


Author: eric_niebler
Date: 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
New Revision: 71832
URL: http://svn.boost.org/trac/boost/changeset/71832

Log:
finish pre-preprocessing proto/transform and proto/detail. only proto/context remains
Added:
   trunk/boost/proto/detail/classtypeof.hpp (contents, props changed)
   trunk/boost/proto/detail/deduce_domain_n.hpp (contents, props changed)
   trunk/boost/proto/detail/memfun_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/poly_function_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/poly_function_traits.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/classtypeof.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/deduce_domain_n.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/memfun_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/poly_function_funop.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/poly_function_traits.hpp (contents, props changed)
   trunk/boost/proto/detail/preprocessed/template_arity_helper.hpp (contents, props changed)
   trunk/boost/proto/detail/template_arity_helper.hpp (contents, props changed)
   trunk/boost/proto/transform/detail/pass_through_impl.hpp (contents, props changed)
   trunk/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp (contents, props changed)
   trunk/boost/proto/transform/detail/preprocessed/when.hpp (contents, props changed)
   trunk/boost/proto/transform/detail/when.hpp (contents, props changed)
Text files modified:
   trunk/boost/proto/detail/decltype.hpp | 30 --
   trunk/boost/proto/detail/deduce_domain.hpp | 32 --
   trunk/boost/proto/detail/funop.hpp | 31 -
   trunk/boost/proto/detail/poly_function.hpp | 454 ++++++++++++++++-----------------------
   trunk/boost/proto/detail/preprocessed/extends_funop.hpp | 22
   trunk/boost/proto/detail/preprocessed/extends_funop_const.hpp | 22
   trunk/boost/proto/detail/template_arity.hpp | 144 +++++-------
   trunk/boost/proto/expr.hpp | 1
   trunk/boost/proto/transform/detail/preprocessed/default_function_impl.hpp | 48 ++--
   trunk/boost/proto/transform/pass_through.hpp | 318 +++++++++++-----------------
   trunk/boost/proto/transform/when.hpp | 453 ++++++++++++++++-----------------------
   trunk/libs/proto/preprocess/preprocess_proto.cpp | 3
   trunk/libs/proto/preprocess/wave.cfg | 6
   13 files changed, 635 insertions(+), 929 deletions(-)

Added: trunk/boost/proto/detail/classtypeof.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/classtypeof.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,49 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/classtypeof.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/classtypeof.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // classtypeof.hpp
+ // Contains specializations of the classtypeof\<\> 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, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/classtypeof.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))>
+ {
+ typedef U type;
+ };
+
+ template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const>
+ {
+ typedef U type;
+ };
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Modified: trunk/boost/proto/detail/decltype.hpp
==============================================================================
--- trunk/boost/proto/detail/decltype.hpp (original)
+++ trunk/boost/proto/detail/decltype.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -32,7 +32,6 @@
 #include <boost/utility/addressof.hpp>
 #include <boost/utility/result_of.hpp>
 #include <boost/utility/enable_if.hpp>
-#include <boost/proto/repeat.hpp>
 
 #ifndef BOOST_NO_DECLTYPE
 # define BOOST_PROTO_DECLTYPE_(EXPR, TYPE) typedef decltype(EXPR) TYPE;
@@ -245,20 +244,8 @@
             typedef U type;
         };
 
- #define BOOST_PP_LOCAL_MACRO(N) \
- template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))> \
- { \
- typedef U type; \
- }; \
- template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct classtypeof<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const> \
- { \
- typedef U type; \
- }; \
- /**/
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PP_LOCAL_ITERATE()
+ // Other specializations are generated by the preprocessor
+ #include <boost/proto/detail/classtypeof.hpp>
 
         ////////////////////////////////////////////////////////////////////////////////////////////
         template<typename T>
@@ -499,17 +486,8 @@
                 return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)();
             }
 
- #define BOOST_PROTO_LOCAL_MACRO(N, typename_A, A_const_ref, A_const_ref_a, a) \
- template<typename_A(N)> \
- result_type operator()(A_const_ref_a(N)) const \
- { \
- BOOST_PROTO_USE_GET_POINTER(); \
- return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a(N)); \
- } \
- /**/
- #define BOOST_PROTO_LOCAL_a BOOST_PROTO_a
- #define BOOST_PROTO_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PROTO_LOCAL_ITERATE()
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/detail/memfun_funop.hpp>
 
         private:
             T obj;

Modified: trunk/boost/proto/detail/deduce_domain.hpp
==============================================================================
--- trunk/boost/proto/detail/deduce_domain.hpp (original)
+++ trunk/boost/proto/detail/deduce_domain.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -151,37 +151,7 @@
>
             {};
 
- #define M0(Z, N, DATA) \
- typedef \
- typename common_domain2<common ## N, A ## N>::type \
- BOOST_PP_CAT(common, BOOST_PP_INC(N)); \
- /**/
-
- #define BOOST_PP_LOCAL_MACRO(N) \
- template<BOOST_PP_ENUM_PARAMS(N, typename A)> \
- struct BOOST_PP_CAT(common_domain, N) \
- { \
- typedef A0 common1; \
- BOOST_PP_REPEAT_FROM_TO(1, N, M0, ~) \
- typedef common ## N type; \
- BOOST_PROTO_ASSERT_VALID_DOMAIN(type); \
- }; \
- \
- template<BOOST_PP_ENUM_PARAMS(N, typename E)> \
- struct BOOST_PP_CAT(deduce_domain, N) \
- : BOOST_PP_CAT(common_domain, N)< \
- BOOST_PP_ENUM_BINARY_PARAMS( \
- N \
- , typename domain_of<E, >::type BOOST_PP_INTERCEPT \
- ) \
- > \
- {}; \
- /**/
-
- #define BOOST_PP_LOCAL_LIMITS (3, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #undef M0
+ #include <boost/proto/detail/deduce_domain_n.hpp>
         }
     }
 }

Added: trunk/boost/proto/detail/deduce_domain_n.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/deduce_domain_n.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,64 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/deduce_domain_n.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_COMMON_DOMAIN2(Z, N, DATA) \
+ typedef \
+ typename common_domain2<common ## N, A ## N>::type \
+ BOOST_PP_CAT(common, BOOST_PP_INC(N)); \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deduce_domain_n.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // deduce_domain_n.hpp
+ // Definitions of common_domain[n] and deduce_domain[n] class templates.
+ //
+ // 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, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deduce_domain_n.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_COMMON_DOMAIN2
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ struct BOOST_PP_CAT(common_domain, N)
+ {
+ typedef A0 common1;
+ BOOST_PP_REPEAT_FROM_TO(1, N, BOOST_PROTO_COMMON_DOMAIN2, ~)
+ typedef BOOST_PP_CAT(common, N) type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename E)>
+ struct BOOST_PP_CAT(deduce_domain, N)
+ : BOOST_PP_CAT(common_domain, N)<
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ N
+ , typename domain_of<E, >::type BOOST_PP_INTERCEPT
+ )
+ >
+ {};
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Modified: trunk/boost/proto/detail/funop.hpp
==============================================================================
--- trunk/boost/proto/detail/funop.hpp (original)
+++ trunk/boost/proto/detail/funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -4,14 +4,13 @@
 
 #elif !defined(BOOST_PP_IS_ITERATING)
 
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/facilities/intercept.hpp>
- #include <boost/preprocessor/repetition/enum_trailing.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+ #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
+ typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
+ /**/
+
+ #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
+ proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
+ /**/
 
     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
         #pragma wave option(preserve: 2, line: 0, output: "preprocessed/funop.hpp")
@@ -29,20 +28,12 @@
         #pragma wave option(preserve: 1)
     #endif
 
- #define M0(Z, N, DATA) \
- typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
- /**/
-
- #define M1(Z, N, DATA) \
- proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
- /**/
-
     #define BOOST_PP_ITERATION_PARAMS_1 \
         (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>))
     #include BOOST_PP_ITERATE()
 
- #undef M1
- #undef M0
+ #undef BOOST_PROTO_AS_CHILD
+ #undef BOOST_PROTO_AS_CHILD_TYPE
 
     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
         #pragma wave option(output: null)
@@ -60,7 +51,7 @@
           , tag::function
           , BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))<
                 Expr &
- BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M0, ~)
+ BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD_TYPE, ~)
>
>::type type;
 
@@ -71,7 +62,7 @@
         {
             type that = {
                 e
- BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M1, ~)
+ BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD, ~)
             };
             return that;
         }

Added: trunk/boost/proto/detail/memfun_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/memfun_funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,44 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/memfun_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/memfun_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // memfun_funop.hpp
+ // Contains overloads of memfun::operator().
+ //
+ // 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/memfun_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(BOOST_PP_ENUM_PARAMS(N, a));
+ }
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Modified: trunk/boost/proto/detail/poly_function.hpp
==============================================================================
--- trunk/boost/proto/detail/poly_function.hpp (original)
+++ trunk/boost/proto/detail/poly_function.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -1,297 +1,219 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file poly_function.hpp
- /// A wrapper that makes a tr1-style function object that handles const
- /// and non-const refs and reference_wrapper arguments, too, and forwards
- /// the arguments on to the specified implementation.
- //
- // 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_DETAIL_POLY_FUNCTION_EAN_2008_05_02
- #define BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
-
- #include <boost/ref.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/mpl/void.hpp>
- #include <boost/mpl/size_t.hpp>
- #include <boost/mpl/eval_if.hpp>
- #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/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/repetition/enum_binary_params.hpp>
- #include <boost/proto/proto_fwd.hpp>
-
- #ifdef _MSC_VER
- # pragma warning(push)
- # pragma warning(disable: 4181) // const applied to reference type
- #endif
-
- namespace boost { namespace proto { namespace detail
- {
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T>
- struct normalize_arg
- {
- typedef T type;
- typedef T const &reference;
- };
+///////////////////////////////////////////////////////////////////////////////
+/// \file poly_function.hpp
+/// A wrapper that makes a tr1-style function object that handles const
+/// and non-const refs and reference_wrapper arguments, too, and forwards
+/// the arguments on to the specified implementation.
+//
+// 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_DETAIL_POLY_FUNCTION_EAN_2008_05_02
+#define BOOST_PROTO_DETAIL_POLY_FUNCTION_EAN_2008_05_02
+
+#include <boost/ref.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/eval_if.hpp>
+#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/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4181) // const applied to reference type
+#endif
 
- template<typename T>
- struct normalize_arg<T &>
- {
- typedef T type;
- typedef T const &reference;
- };
+namespace boost { namespace proto { namespace detail
+{
 
- template<typename T>
- struct normalize_arg<T const &>
- {
- typedef T type;
- typedef T const &reference;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T>
+ struct normalize_arg
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<T &>
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<T const &>
+ {
+ typedef T type;
+ typedef T const &reference;
+ };
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> >
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> >
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> &>
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ template<typename T>
+ struct normalize_arg<boost::reference_wrapper<T> const &>
+ {
+ typedef T &type;
+ typedef T &reference;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T>
+ struct arg
+ {
+ typedef T const &type;
+
+ arg(type t)
+ : value(t)
+ {}
+
+ operator type() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return this->value;
+ }
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> &>
+ type operator()() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return *this;
+ }
+
+ private:
+ arg &operator =(arg const &);
+ type value;
+ };
+
+ template<typename T>
+ struct arg<T &>
+ {
+ typedef T &type;
+
+ arg(type t)
+ : value(t)
+ {}
 
- template<typename T>
- struct normalize_arg<boost::reference_wrapper<T> const &>
+ operator type() const
         {
- typedef T &type;
- typedef T &reference;
- };
+ return this->value;
+ }
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T>
- struct arg
+ type operator()() const
         {
- typedef T const &type;
+ return *this;
+ }
 
- arg(type t)
- : value(t)
- {}
-
- operator type() const
- {
- return this->value;
- }
-
- type operator()() const
- {
- return *this;
- }
-
- private:
- arg &operator =(arg const &);
- type value;
- };
+ private:
+ arg &operator =(arg const &);
+ type value;
+ };
 
- template<typename T>
- struct arg<T &>
- {
- typedef T &type;
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename T, typename Void = void>
+ struct is_poly_function
+ : mpl::false_
+ {};
 
- arg(type t)
- : value(t)
- {}
-
- operator type() const
- {
- return this->value;
- }
-
- type operator()() const
- {
- return *this;
- }
-
- private:
- arg &operator =(arg const &);
- type value;
- };
+ template<typename T>
+ struct is_poly_function<T, typename T::is_poly_function_base_>
+ : mpl::true_
+ {};
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T, typename Void = void>
- struct is_poly_function
- : mpl::false_
- {};
-
- template<typename T>
- struct is_poly_function<T, typename T::is_poly_function_base_>
- : mpl::true_
- {};
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- #define BOOST_PROTO_POLY_FUNCTION() \
- typedef void is_poly_function_base_; \
- /**/
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ #define BOOST_PROTO_POLY_FUNCTION() \
+ typedef void is_poly_function_base_; \
+ /**/
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- struct poly_function_base
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ struct poly_function_base
+ {
+ /// INTERNAL ONLY
+ BOOST_PROTO_POLY_FUNCTION()
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Derived, typename NullaryResult = void>
+ struct poly_function
+ : poly_function_base
+ {
+ template<typename Sig>
+ struct result;
+
+ template<typename This>
+ struct result<This()>
+ : Derived::template impl<>
         {
- /// INTERNAL ONLY
- BOOST_PROTO_POLY_FUNCTION()
+ typedef typename result::result_type type;
         };
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Derived, typename NullaryResult = void>
- struct poly_function
- : poly_function_base
+ NullaryResult operator()() const
         {
- template<typename Sig>
- struct result;
+ result<Derived const()> impl;
+ return impl();
+ }
 
- template<typename This>
- struct result<This()>
- : Derived::template impl<>
- {
- typedef typename result::result_type type;
- };
-
- NullaryResult operator()() const
- {
- result<Derived const()> impl;
- return impl();
- }
+ #include <boost/proto/detail/poly_function_funop.hpp>
+ };
 
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 0))
- #include BOOST_PP_ITERATE()
- };
+ template<typename T>
+ struct wrap_t;
 
- template<typename T>
- struct wrap_t;
+ typedef char poly_function_t;
+ typedef char (&mono_function_t)[2];
+ typedef char (&unknown_function_t)[3];
 
- typedef char poly_function_t;
- typedef char (&mono_function_t)[2];
- typedef char (&unknown_function_t)[3];
-
- template<typename T> poly_function_t test_poly_function(T *, wrap_t<typename T::is_poly_function_base_> * = 0);
- template<typename T> mono_function_t test_poly_function(T *, wrap_t<typename T::result_type> * = 0);
- template<typename T> unknown_function_t test_poly_function(T *, ...);
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> >
- struct poly_function_traits
- {
- typedef typename Fun::template result<Sig>::type result_type;
- typedef Fun function_type;
- };
+ template<typename T> poly_function_t test_poly_function(T *, wrap_t<typename T::is_poly_function_base_> * = 0);
+ template<typename T> mono_function_t test_poly_function(T *, wrap_t<typename T::result_type> * = 0);
+ template<typename T> unknown_function_t test_poly_function(T *, ...);
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename Fun, typename Sig>
- struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> >
- {
- typedef typename Fun::result_type result_type;
- typedef Fun function_type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> >
+ struct poly_function_traits
+ {
+ typedef typename Fun::template result<Sig>::type result_type;
+ typedef Fun function_type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename Fun, typename Sig>
+ struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> >
+ {
+ typedef typename Fun::result_type result_type;
+ typedef Fun function_type;
+ };
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFunSig, bool IsPolyFunction>
- struct as_mono_function_impl;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFunSig>
- struct as_mono_function;
-
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function.hpp>, 1))
- #include BOOST_PP_ITERATE()
-
- }}} // namespace boost::proto::detail
-
- #ifdef _MSC_VER
- # pragma warning(pop)
- #endif
-
- #endif
-
-#elif 0 == BOOST_PP_ITERATION_FLAGS()
-
- #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))>
- : Derived::template impl<
- BOOST_PP_ENUM_BINARY_PARAMS(
- N
- , typename normalize_arg<A
- , >::type BOOST_PP_INTERCEPT
- )
- >
- {
- typedef typename result::result_type type;
- };
-
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- typename result<
- Derived const(
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
- )
- >::type
- operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
- {
- result<
- Derived const(
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
- )
- > impl;
-
- #define M0(Z, N, DATA) \
- static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \
- ::reference>(BOOST_PP_CAT(a, N))
- return impl(BOOST_PP_ENUM(N, M0, ~));
- #undef M0
- }
-
- #undef N
-
-#elif 1 == BOOST_PP_ITERATION_FLAGS()
-
- #define N BOOST_PP_ITERATION()
-
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
- {
- typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
- typedef typename function_type::result_type result_type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFunSig, bool IsPolyFunction>
+ struct as_mono_function_impl;
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true>
- {
- typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type;
- };
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFunSig>
+ struct as_mono_function;
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false>
- {
- typedef PolyFun type;
- };
+ #include <boost/proto/detail/poly_function_traits.hpp>
 
- ////////////////////////////////////////////////////////////////////////////////////////////////
- template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))>
- : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value>
- {};
+}}} // namespace boost::proto::detail
 
- #undef N
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
 #endif
+

Added: trunk/boost/proto/detail/poly_function_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/poly_function_funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,74 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/poly_function_funop.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_NORMALIZE_ARG(Z, N, DATA) \
+ static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \
+ ::reference>(BOOST_PP_CAT(a, N)) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/poly_function_funop.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_funop.hpp
+ // Contains overloads of poly_function\<\>::operator()
+ //
+ // 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/poly_function_funop.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_NORMALIZE_ARG
+
+#else
+
+ #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))>
+ : Derived::template impl<
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ N
+ , typename normalize_arg<A
+ , >::type BOOST_PP_INTERCEPT
+ )
+ >
+ {
+ typedef typename result::result_type type;
+ };
+
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ typename result<
+ Derived const(
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ )
+ >::type
+ operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
+ {
+ result<
+ Derived const(
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ )
+ > impl;
+
+ return impl(BOOST_PP_ENUM(N, BOOST_PROTO_NORMALIZE_ARG, ~));
+ }
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: trunk/boost/proto/detail/poly_function_traits.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/poly_function_traits.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,65 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/poly_function_traits.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/poly_function_traits.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_traits.hpp
+ // Contains specializations of poly_function_traits and as_mono_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, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function_traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true>
+ {
+ typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false>
+ {
+ typedef PolyFun type;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+ template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))>
+ : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value>
+ {};
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Added: trunk/boost/proto/detail/preprocessed/classtypeof.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/classtypeof.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,117 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // classtypeof.hpp
+ // Contains specializations of the classtypeof\<\> 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 T, typename U >
+ struct classtypeof<T (U::*)()>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U >
+ struct classtypeof<T (U::*)() const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0>
+ struct classtypeof<T (U::*)(A0)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0>
+ struct classtypeof<T (U::*)(A0) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1>
+ struct classtypeof<T (U::*)(A0 , A1)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1>
+ struct classtypeof<T (U::*)(A0 , A1) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2>
+ struct classtypeof<T (U::*)(A0 , A1 , A2)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2>
+ struct classtypeof<T (U::*)(A0 , A1 , A2) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) const>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ {
+ typedef U type;
+ };
+ template<typename T, typename U , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct classtypeof<T (U::*)(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) const>
+ {
+ typedef U type;
+ };

Added: trunk/boost/proto/detail/preprocessed/deduce_domain_n.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/deduce_domain_n.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,119 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // deduce_domain_n.hpp
+ // Definitions of common_domain[n] and deduce_domain[n] class templates.
+ //
+ // 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 A0 , typename A1 , typename A2>
+ struct common_domain3
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3;
+ typedef common3 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2>
+ struct deduce_domain3
+ : common_domain3<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ struct common_domain4
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4;
+ typedef common4 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3>
+ struct deduce_domain4
+ : common_domain4<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct common_domain5
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5;
+ typedef common5 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4>
+ struct deduce_domain5
+ : common_domain5<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct common_domain6
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6;
+ typedef common6 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5>
+ struct deduce_domain6
+ : common_domain6<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct common_domain7
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7;
+ typedef common7 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6>
+ struct deduce_domain7
+ : common_domain7<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct common_domain8
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8;
+ typedef common8 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7>
+ struct deduce_domain8
+ : common_domain8<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct common_domain9
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9;
+ typedef common9 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8>
+ struct deduce_domain9
+ : common_domain9<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type
+ >
+ {};
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct common_domain10
+ {
+ typedef A0 common1;
+ typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9; typedef typename common_domain2<common9, A9>::type common10;
+ typedef common10 type;
+ BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
+ };
+ template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8 , typename E9>
+ struct deduce_domain10
+ : common_domain10<
+ typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type , typename domain_of<E9 >::type
+ >
+ {};

Modified: trunk/boost/proto/detail/preprocessed/extends_funop.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/extends_funop.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/extends_funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -5,14 +5,14 @@
     // 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 Sig> struct result { typedef typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
- typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); } typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr , proto_domain >::type ) >::type const operator ()() { typedef boost::proto::result_of::funop0< proto_derived_expr , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) ) ); }
- template<typename A0> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); } template<typename A0> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) { typedef boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 ) ); }
- template<typename A0 , typename A1> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); } template<typename A0 , typename A1> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) { typedef boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 ) ); }
- template<typename A0 , typename A1 , typename A2> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); } template<typename A0 , typename A1 , typename A2> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) { typedef boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(th
is) , a0 , a1 , a2 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) { typedef boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1
, const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) { t
ypedef boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator
 ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) { typedef boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , cons
t A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) { typedef boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::
funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) { typedef boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename boo
st::tr1_result_of< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) { typedef boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }
+ template<typename Sig> struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
+ typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); } typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr , proto_domain >::type ) >::type const operator ()() { typedef boost::proto::result_of::funop0< proto_derived_expr , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) ) ); }
+ template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); } template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) { typedef boost::proto::result_of::funop1< proto_derived_expr , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 ) ); }
+ template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); } template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) { typedef boost::proto::result_of::funop2< proto_derived_expr , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 ) ); }
+ template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); } template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) { typedef boost::proto::result_of::funop3< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(
this) , a0 , a1 , a2 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) { typedef boost::proto::result_of::funop4< proto_derived_expr , proto_domain , const A0 , const A
1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) {
 typedef boost::proto::result_of::funop5< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operat
or ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) { typedef boost::proto::result_of::funop6< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , co
nst A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) { typedef boost::proto::result_of::funop7< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of
::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) { typedef boost::proto::result_of::funop8< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); } template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BO
OST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) { typedef boost::proto::result_of::funop9< proto_derived_expr , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }

Modified: trunk/boost/proto/detail/preprocessed/extends_funop_const.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/extends_funop_const.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/extends_funop_const.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -5,14 +5,14 @@
     // 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 Sig> struct result { typedef typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
- typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); }
- template<typename A0> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); }
- template<typename A0 , typename A1> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); }
- template<typename A0 , typename A1 , typename A2> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
- template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename boost::tr1_result_of< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }
+ template<typename Sig> struct result { typedef typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop< Sig , proto_derived_expr , proto_domain >::type ) >::type const type; };
+ typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop0< proto_derived_expr const , proto_domain >::type ) >::type const operator ()() const { typedef boost::proto::result_of::funop0< proto_derived_expr const , proto_domain > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) ) ); }
+ template<typename A0> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 >::type ) >::type const operator ()(A0 const &a0) const { typedef boost::proto::result_of::funop1< proto_derived_expr const , proto_domain , const A0 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 ) ); }
+ template<typename A0 , typename A1> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1) const { typedef boost::proto::result_of::funop2< proto_derived_expr const , proto_domain , const A0 , const A1 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 ) ); }
+ template<typename A0 , typename A1 , typename A2> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const { typedef boost::proto::result_of::funop3< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const { typedef boost::proto::result_of::funop4< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const { typedef boost::proto::result_of::funop5< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const { typedef boost::proto::result_of::funop6< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const { typedef boost::proto::result_of::funop7< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const { typedef boost::proto::result_of::funop8< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 ) ); }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> typename BOOST_PROTO_RESULT_OF< proto_generator( typename boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 >::type ) >::type const operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const { typedef boost::proto::result_of::funop9< proto_derived_expr const , proto_domain , const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 > funop; return proto_generator()( funop::call( *static_cast<proto_derived_expr const *>(this) , a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 ) ); }

Added: trunk/boost/proto/detail/preprocessed/memfun_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/memfun_funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // memfun_funop.hpp
+ // Contains overloads of memfun::operator().
+ //
+ // 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 A0>
+ result_type operator()(A0 const &a0) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0);
+ }
+ template<typename A0 , typename A1>
+ result_type operator()(A0 const &a0 , A1 const &a1) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1);
+ }
+ template<typename A0 , typename A1 , typename A2>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
+ }
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ result_type operator()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9) const
+ {
+ BOOST_PROTO_USE_GET_POINTER();
+ return (BOOST_PROTO_GET_POINTER(V, obj) ->* pmf)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
+ }

Added: trunk/boost/proto/detail/preprocessed/poly_function_funop.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/poly_function_funop.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,237 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_funop.hpp
+ // Contains overloads of poly_function\<\>::operator()
+ //
+ // 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>
+ struct result<This(A0)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0>
+ typename result<
+ Derived const(
+ A0 const &
+ )
+ >::type
+ operator ()(A0 const &a0) const
+ {
+ result<
+ Derived const(
+ A0 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0));
+ }
+ template<typename This , typename A0 , typename A1>
+ struct result<This(A0 , A1)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1>
+ typename result<
+ Derived const(
+ A0 const & , A1 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2>
+ struct result<This(A0 , A1 , A2)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3>
+ struct result<This(A0 , A1 , A2 , A3)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct result<This(A0 , A1 , A2 , A3 , A4)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8));
+ }
+ template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : Derived::template impl<
+ typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type , typename normalize_arg<A9 >::type
+ >
+ {
+ typedef typename result::result_type type;
+ };
+ template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ typename result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
+ )
+ >::type
+ operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9) const
+ {
+ result<
+ Derived const(
+ A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
+ )
+ > impl;
+ return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8) , static_cast<typename normalize_arg<A9 const &> ::reference>(a9));
+ }

Added: trunk/boost/proto/detail/preprocessed/poly_function_traits.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/poly_function_traits.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,247 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // poly_function_traits.hpp
+ // Contains specializations of poly_function_traits and as_mono_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 PolyFun , typename A0>
+ struct poly_function_traits<PolyFun, PolyFun(A0), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function_impl<PolyFun(A0), true>
+ {
+ typedef typename PolyFun::template impl<const A0> type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function_impl<PolyFun(A0), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0>
+ struct as_mono_function<PolyFun(A0)>
+ : as_mono_function_impl<PolyFun(A0), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function_impl<PolyFun(A0 , A1), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function_impl<PolyFun(A0 , A1), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1>
+ struct as_mono_function<PolyFun(A0 , A1)>
+ : as_mono_function_impl<PolyFun(A0 , A1), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2>
+ struct as_mono_function<PolyFun(A0 , A1 , A2)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), is_poly_function<PolyFun>::value>
+ {};
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct poly_function_traits<PolyFun, PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), mpl::size_t<sizeof(poly_function_t)> >
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9> function_type;
+ typedef typename function_type::result_type result_type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), true>
+ {
+ typedef typename PolyFun::template impl<const A0 , const A1 , const A2 , const A3 , const A4 , const A5 , const A6 , const A7 , const A8 , const A9> type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), false>
+ {
+ typedef PolyFun type;
+ };
+
+ template<typename PolyFun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct as_mono_function<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : as_mono_function_impl<PolyFun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9), is_poly_function<PolyFun>::value>
+ {};

Added: trunk/boost/proto/detail/preprocessed/template_arity_helper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/preprocessed/template_arity_helper.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,67 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ // template_arity_helper.hpp
+ // Overloads of template_arity_helper, used by the template_arity\<\> 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<
+ template<typename P0> class F
+ , typename T0
+ >
+ sized_type<2>::type
+ template_arity_helper(F<T0> **, mpl::int_<1> *);
+ template<
+ template<typename P0 , typename P1> class F
+ , typename T0 , typename T1
+ >
+ sized_type<3>::type
+ template_arity_helper(F<T0 , T1> **, mpl::int_<2> *);
+ template<
+ template<typename P0 , typename P1 , typename P2> class F
+ , typename T0 , typename T1 , typename T2
+ >
+ sized_type<4>::type
+ template_arity_helper(F<T0 , T1 , T2> **, mpl::int_<3> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3> class F
+ , typename T0 , typename T1 , typename T2 , typename T3
+ >
+ sized_type<5>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3> **, mpl::int_<4> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4
+ >
+ sized_type<6>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4> **, mpl::int_<5> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5
+ >
+ sized_type<7>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5> **, mpl::int_<6> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6
+ >
+ sized_type<8>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6> **, mpl::int_<7> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7
+ >
+ sized_type<9>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7> **, mpl::int_<8> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8
+ >
+ sized_type<10>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8> **, mpl::int_<9> *);
+ template<
+ template<typename P0 , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9> class F
+ , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9
+ >
+ sized_type<11>::type
+ template_arity_helper(F<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9> **, mpl::int_<10> *);

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-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -1,83 +1,67 @@
-#ifndef BOOST_PP_IS_ITERATING
-
- ///////////////////////////////////////////////////////////////////////////////
- /// \file template_arity.hpp
- /// Replace all nodes stored by reference by nodes stored by value.
- //
- // Copyright 2011 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)
- //
- // This file is based on a similar one in MPL from Aleksey Gurtovoy.
-
- #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>
- #include <boost/preprocessor/inc.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/mpl/int.hpp>
- #include <boost/proto/proto_fwd.hpp>
-
- #undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2
- #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param
-
- namespace boost { namespace proto { namespace detail
- {
- sized_type<1>::type arity_helper(...);
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/template_arity.hpp>))
- #include BOOST_PP_ITERATE()
-
- template<typename F, int N, int Size>
- struct template_arity_impl2
- : mpl::int_<Size - 1>
- {};
-
- template<typename F, int N = BOOST_PROTO_MAX_ARITY>
- struct template_arity
- : template_arity_impl2<
- F
- , N
- , sizeof(detail::arity_helper((F **)0, (mpl::int_<N> *)0))
- >
- {};
-
- template<typename F, int N>
- struct template_arity_impl2<F, N, 1>
- : template_arity<F, N-1>
- {};
-
- template<typename F>
- struct template_arity_impl2<F, 0, 1>
- : mpl::int_<-1>
- {};
-
- }}}
-
- #endif // BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
- #endif // BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
-
-#else
-
- #define N BOOST_PP_ITERATION()
-
- template<
- template<BOOST_PP_ENUM_PARAMS(N, typename P)> class F
- , BOOST_PP_ENUM_PARAMS(N, typename T)
+///////////////////////////////////////////////////////////////////////////////
+/// \file template_arity.hpp
+/// Replace all nodes stored by reference by nodes stored by value.
+//
+// Copyright 2011 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)
+//
+// This file is based on a similar one in MPL from Aleksey Gurtovoy.
+
+#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)
+
+#if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \
+ (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/inc.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+#undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2
+#define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param
+
+namespace boost { namespace proto { namespace detail
+{
+ sized_type<1>::type template_arity_helper(...);
+
+ // Other overloads generated by the preprocessor
+ #include <boost/proto/detail/template_arity_helper.hpp>
+
+ template<typename F, int N, int Size>
+ struct template_arity_impl2
+ : mpl::int_<Size - 1>
+ {};
+
+ template<typename F, int N = BOOST_PROTO_MAX_ARITY>
+ struct template_arity
+ : template_arity_impl2<
+ F
+ , N
+ , sizeof(detail::template_arity_helper((F **)0, (mpl::int_<N> *)0))
>
- sized_type<BOOST_PP_INC(N)>::type arity_helper(F<BOOST_PP_ENUM_PARAMS(N, T)> **, mpl::int_<N> *);
+ {};
+
+ template<typename F, int N>
+ struct template_arity_impl2<F, N, 1>
+ : template_arity<F, N-1>
+ {};
+
+ template<typename F>
+ struct template_arity_impl2<F, 0, 1>
+ : mpl::int_<-1>
+ {};
 
- #undef N
+}}}
 
-#endif // BOOST_PP_IS_ITERATING
+#endif // BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+#endif // BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07

Added: trunk/boost/proto/detail/template_arity_helper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/detail/template_arity_helper.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,44 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/detail/preprocessed/template_arity_helper.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/template_arity_helper.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // template_arity_helper.hpp
+ // Overloads of template_arity_helper, used by the template_arity\<\> 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/template_arity_helper.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<
+ template<BOOST_PP_ENUM_PARAMS(N, typename P)> class F
+ , BOOST_PP_ENUM_PARAMS(N, typename T)
+ >
+ sized_type<BOOST_PP_INC(N)>::type
+ template_arity_helper(F<BOOST_PP_ENUM_PARAMS(N, T)> **, mpl::int_<N> *);
+
+ #undef N
+
+#endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES

Modified: trunk/boost/proto/expr.hpp
==============================================================================
--- trunk/boost/proto/expr.hpp (original)
+++ trunk/boost/proto/expr.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -13,6 +13,7 @@
 #include <boost/preprocessor/arithmetic/dec.hpp>
 #include <boost/preprocessor/selection/max.hpp>
 #include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
 #include <boost/preprocessor/repetition/enum_trailing.hpp>

Added: trunk/boost/proto/transform/detail/pass_through_impl.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/pass_through_impl.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,95 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/pass_through_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA) \
+ typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , State \
+ , Data \
+ >::result_type \
+ /**/
+
+ #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA) \
+ typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
+ typename result_of::child_c<Expr, N>::type \
+ , State \
+ , Data \
+ >()( \
+ e.proto_base().BOOST_PP_CAT(child, N), s, d \
+ ) \
+ /**/
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/pass_through_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pass_through_impl.hpp
+ ///
+ /// Specializations of pass_through_impl, used in the implementation of the
+ /// pass_through 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
+
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/pass_through_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #undef BOOST_PROTO_DEFINE_TRANSFORM
+ #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, N>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , BOOST_PP_CAT(list, N)<
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
+ >
+ >::type
+ expr_type;
+
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
+ };
+ // Without this, MSVC complains that "that" is uninitialized,
+ // and it actually triggers a runtime check in debug mode when
+ // built with VC8.
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+
+ #undef N
+
+#endif

Modified: trunk/boost/proto/transform/detail/preprocessed/default_function_impl.hpp
==============================================================================
--- trunk/boost/proto/transform/detail/preprocessed/default_function_impl.hpp (original)
+++ trunk/boost/proto/transform/detail/preprocessed/default_function_impl.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -15,7 +15,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2)
>::type
         result_type;
@@ -46,10 +46,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ));
         }
@@ -63,7 +63,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3)
>::type
         result_type;
@@ -94,10 +94,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ));
         }
@@ -111,7 +111,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4)
>::type
         result_type;
@@ -142,10 +142,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ));
         }
@@ -159,7 +159,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4 , r5)
>::type
         result_type;
@@ -190,10 +190,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ));
         }
@@ -207,7 +207,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4 , r5 , r6)
>::type
         result_type;
@@ -238,10 +238,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ));
         }
@@ -255,7 +255,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7)
>::type
         result_type;
@@ -286,10 +286,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ));
         }
@@ -303,7 +303,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7 , r8)
>::type
         result_type;
@@ -334,10 +334,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ));
         }
@@ -351,7 +351,7 @@
             typename proto::detail::result_of_fixup<r0>::type
         function_type;
         typedef
- typename boost::tr1_result_of<
+ typename BOOST_PROTO_RESULT_OF<
                 function_type(r1 , r2 , r3 , r4 , r5 , r6 , r7 , r8 , r9)
>::type
         result_type;
@@ -382,10 +382,10 @@
           , mpl::true_
         ) const
         {
- using namespace boost::proto::detail::get_pointerns;
+ BOOST_PROTO_USE_GET_POINTER();
             typedef typename detail::classtypeof<function_type>::type class_type;
             return (
- boost::proto::detail::proto_get_pointer<class_type>( boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )) , (true ? 0 : get_pointer( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) , (true ? 0 : boost::addressof(boost::proto::detail::lvalue( typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d )))) ) ->*
+ BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
                 typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
             )(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ) , typename Grammar::template impl<e9, State, Data>()( proto::child_c< 9>( e), s, d ));
         }

Added: trunk/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,329 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pass_through_impl.hpp
+ ///
+ /// Specializations of pass_through_impl, used in the implementation of the
+ /// pass_through 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 Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 1>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list1<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 2>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list2<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 3>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list3<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 4>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list4<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 5>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list5<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 6>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list6<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 7>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list7<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 8>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list8<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 9>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list9<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type , typename Grammar::proto_ch
ild8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d ) , typename Grammar::proto_child8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >()( e.proto_base().child8, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 10>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef typename pass_through_impl::expr unref_expr;
+ typedef
+ typename base_expr<
+ typename unref_expr::proto_domain
+ , typename unref_expr::proto_tag
+ , list10<
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >::result_type , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >::result_type , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >::result_type , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >::result_type , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >::result_type , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >::result_type , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >::result_type , typename Grammar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >::result_type , typename Grammar::proto_ch
ild8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >::result_type , typename Grammar::proto_child9::template impl< typename result_of::child_c<Expr, 9>::type , State , Data >::result_type
+ >
+ >::type
+ expr_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
+ result_type const operator ()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param s
+ , typename pass_through_impl::data_param d
+ ) const
+ {
+ expr_type const that = {
+ typename Grammar::proto_child0::template impl< typename result_of::child_c<Expr, 0>::type , State , Data >()( e.proto_base().child0, s, d ) , typename Grammar::proto_child1::template impl< typename result_of::child_c<Expr, 1>::type , State , Data >()( e.proto_base().child1, s, d ) , typename Grammar::proto_child2::template impl< typename result_of::child_c<Expr, 2>::type , State , Data >()( e.proto_base().child2, s, d ) , typename Grammar::proto_child3::template impl< typename result_of::child_c<Expr, 3>::type , State , Data >()( e.proto_base().child3, s, d ) , typename Grammar::proto_child4::template impl< typename result_of::child_c<Expr, 4>::type , State , Data >()( e.proto_base().child4, s, d ) , typename Grammar::proto_child5::template impl< typename result_of::child_c<Expr, 5>::type , State , Data >()( e.proto_base().child5, s, d ) , typename Grammar::proto_child6::template impl< typename result_of::child_c<Expr, 6>::type , State , Data >()( e.proto_base().child6, s, d ) , typename Gra
mmar::proto_child7::template impl< typename result_of::child_c<Expr, 7>::type , State , Data >()( e.proto_base().child7, s, d ) , typename Grammar::proto_child8::template impl< typename result_of::child_c<Expr, 8>::type , State , Data >()( e.proto_base().child8, s, d ) , typename Grammar::proto_child9::template impl< typename result_of::child_c<Expr, 9>::type , State , Data >()( e.proto_base().child9, s, d )
+ };
+
+
+
+ detail::ignore_unused(&that);
+ return proto_generator()(that);
+ }
+ };

Added: trunk/boost/proto/transform/detail/preprocessed/when.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/preprocessed/when.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,744 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file when.hpp
+ /// Definition of when 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 Grammar, typename R >
+ struct when<Grammar, R()>
+ : transform<when<Grammar, R()> >
+ {
+ typedef Grammar first;
+ typedef R second();
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R()>
+ , make<R()>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0>
+ struct when<Grammar, R(A0)>
+ : transform<when<Grammar, R(A0)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0)>
+ , make<R(A0)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1>
+ struct when<Grammar, R(A0 , A1)>
+ : transform<when<Grammar, R(A0 , A1)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1)>
+ , make<R(A0 , A1)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2>
+ struct when<Grammar, R(A0 , A1 , A2)>
+ : transform<when<Grammar, R(A0 , A1 , A2)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2)>
+ , make<R(A0 , A1 , A2)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3>
+ struct when<Grammar, R(A0 , A1 , A2 , A3)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3)>
+ , make<R(A0 , A1 , A2 , A3)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4)>
+ , make<R(A0 , A1 , A2 , A3 , A4)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
+ {
+ typedef Grammar first;
+ typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9);
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ >::type
+ which;
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+
+
+
+
+
+
+
+
+
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };

Added: trunk/boost/proto/transform/detail/when.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/proto/transform/detail/when.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -0,0 +1,109 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/when.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/when.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file when.hpp
+ /// Definition of when 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
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/when.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+
+ #define N BOOST_PP_ITERATION()
+
+ /// \brief A grammar element and a PrimitiveTransform that associates
+ /// a transform with the grammar.
+ ///
+ /// Use <tt>when\<\></tt> to override a grammar's default transform
+ /// with a custom transform. It is for used when composing larger
+ /// transforms by associating smaller transforms with individual
+ /// rules in your grammar, as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
+ /// CallableTransform or an ObjectTransform as its second parameter.
+ /// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
+ /// distinguish between the two, and uses <tt>call\<\></tt> to
+ /// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
+ /// ObjectTransforms.
+ template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
+ : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
+ {
+ typedef Grammar first;
+ typedef R second(BOOST_PP_ENUM_PARAMS(N, A));
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+ // Note: do not evaluate is_callable<R> in this scope.
+ // R may be an incomplete type at this point.
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ // OK to evaluate is_callable<R> here. R should be compete by now.
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
+ , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
+ >::type
+ which;
+
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+ /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
+ /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
+ /// whether <tt>is_callable\<R\>::value</tt> is \c true or
+ /// \c false.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
+ /// \return <tt>which()(e, s, d)</tt>
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+
+ #undef N
+
+#endif

Modified: trunk/boost/proto/transform/pass_through.hpp
==============================================================================
--- trunk/boost/proto/transform/pass_through.hpp (original)
+++ trunk/boost/proto/transform/pass_through.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -1,204 +1,136 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file pass_through.hpp
- ///
- /// Definition of the pass_through transform, which is the default transform
- /// of all of the expression generator metafunctions such as unary_plus<>, plus<>
- /// and nary_expr<>.
- //
- // 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_PASS_THROUGH_HPP_EAN_12_26_2006
- #define BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/repetition/enum.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/args.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file pass_through.hpp
+///
+/// Definition of the pass_through transform, which is the default transform
+/// of all of the expression generator metafunctions such as unary_plus<>, plus<>
+/// and nary_expr<>.
+//
+// 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_PASS_THROUGH_HPP_EAN_12_26_2006
+#define BOOST_PROTO_TRANSFORM_PASS_THROUGH_HPP_EAN_12_26_2006
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/args.hpp>
+#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/detail/ignore_unused.hpp>
+
+namespace boost { namespace proto
+{
+ namespace detail
     {
- namespace detail
- {
- template<
- typename Grammar
- , typename Expr
- , typename State
- , typename Data
- , long Arity = arity_of<Expr>::value
- >
- struct pass_through_impl
- {};
-
- #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA) \
- typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , State \
- , Data \
- >::result_type \
- /**/
-
- #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA) \
- typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
- typename result_of::child_c<Expr, N>::type \
- , State \
- , Data \
- >()( \
- e.proto_base().BOOST_PP_CAT(child, N), s, d \
- ) \
- /**/
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/pass_through.hpp>))
- #include BOOST_PP_ITERATE()
-
- #undef BOOST_PROTO_DEFINE_TRANSFORM
- #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
-
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct pass_through_impl<Grammar, Expr, State, Data, 0>
- : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param e An expression
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename pass_through_impl::expr_param
- #endif
- operator()(
- typename pass_through_impl::expr_param e
- , typename pass_through_impl::state_param
- , typename pass_through_impl::data_param
- ) const
- {
- return e;
- }
- };
-
- } // namespace detail
-
- /// \brief A PrimitiveTransform that transforms the child expressions
- /// of an expression node according to the corresponding children of
- /// a Grammar.
- ///
- /// Given a Grammar such as <tt>plus\<T0, T1\></tt>, an expression type
- /// that matches the grammar such as <tt>plus\<E0, E1\>::type</tt>, a
- /// state \c S and a data \c V, the result of applying the
- /// <tt>pass_through\<plus\<T0, T1\> \></tt> transform is:
- ///
- /// \code
- /// plus<
- /// T0::result<T0(E0, S, V)>::type
- /// , T1::result<T1(E1, S, V)>::type
- /// >::type
- /// \endcode
- ///
- /// The above demonstrates how child transforms and child expressions
- /// are applied pairwise, and how the results are reassembled into a new
- /// expression node with the same tag type as the original.
- ///
- /// The explicit use of <tt>pass_through\<\></tt> is not usually needed,
- /// since the expression generator metafunctions such as
- /// <tt>plus\<\></tt> have <tt>pass_through\<\></tt> as their default
- /// transform. So, for instance, these are equivalent:
- ///
- /// \code
- /// // Within a grammar definition, these are equivalent:
- /// when< plus<X, Y>, pass_through< plus<X, Y> > >
- /// when< plus<X, Y>, plus<X, Y> >
- /// when< plus<X, Y> > // because of when<class X, class Y=X>
- /// plus<X, Y> // because plus<> is both a
- /// // grammar and a transform
- /// \endcode
- ///
- /// For example, consider the following transform that promotes all
- /// \c float terminals in an expression to \c double.
- ///
- /// \code
- /// // This transform finds all float terminals in an expression and promotes
- /// // them to doubles.
- /// struct Promote
- /// : or_<
- /// when<terminal<float>, terminal<double>::type(_value) >
- /// // terminal<>'s default transform is a no-op:
- /// , terminal<_>
- /// // nary_expr<> has a pass_through<> transform:
- /// , nary_expr<_, vararg<Promote> >
- /// >
- /// {};
- /// \endcode
- template<typename Grammar>
- struct pass_through
- : transform<pass_through<Grammar> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<Grammar, Expr, State, Data>
- {};
- };
-
- /// INTERNAL ONLY
- ///
- template<typename Grammar>
- struct is_callable<pass_through<Grammar> >
- : mpl::true_
+ template<
+ typename Grammar
+ , typename Expr
+ , typename State
+ , typename Data
+ , long Arity = arity_of<Expr>::value
+ >
+ struct pass_through_impl
         {};
 
- }} // namespace boost::proto
+ #include <boost/proto/transform/detail/pass_through_impl.hpp>
 
- #endif
+ template<typename Grammar, typename Expr, typename State, typename Data>
+ struct pass_through_impl<Grammar, Expr, State, Data, 0>
+ : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
 
-#else
+ /// \param e An expression
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename pass_through_impl::expr_param
+ #endif
+ operator()(
+ typename pass_through_impl::expr_param e
+ , typename pass_through_impl::state_param
+ , typename pass_through_impl::data_param
+ ) const
+ {
+ return e;
+ }
+ };
 
- #define N BOOST_PP_ITERATION()
+ } // namespace detail
 
- template<typename Grammar, typename Expr, typename State, typename Data>
- struct pass_through_impl<Grammar, Expr, State, Data, N>
- : transform_impl<Expr, State, Data>
- {
- typedef typename pass_through_impl::expr unref_expr;
+ /// \brief A PrimitiveTransform that transforms the child expressions
+ /// of an expression node according to the corresponding children of
+ /// a Grammar.
+ ///
+ /// Given a Grammar such as <tt>plus\<T0, T1\></tt>, an expression type
+ /// that matches the grammar such as <tt>plus\<E0, E1\>::type</tt>, a
+ /// state \c S and a data \c V, the result of applying the
+ /// <tt>pass_through\<plus\<T0, T1\> \></tt> transform is:
+ ///
+ /// \code
+ /// plus<
+ /// T0::result<T0(E0, S, V)>::type
+ /// , T1::result<T1(E1, S, V)>::type
+ /// >::type
+ /// \endcode
+ ///
+ /// The above demonstrates how child transforms and child expressions
+ /// are applied pairwise, and how the results are reassembled into a new
+ /// expression node with the same tag type as the original.
+ ///
+ /// The explicit use of <tt>pass_through\<\></tt> is not usually needed,
+ /// since the expression generator metafunctions such as
+ /// <tt>plus\<\></tt> have <tt>pass_through\<\></tt> as their default
+ /// transform. So, for instance, these are equivalent:
+ ///
+ /// \code
+ /// // Within a grammar definition, these are equivalent:
+ /// when< plus<X, Y>, pass_through< plus<X, Y> > >
+ /// when< plus<X, Y>, plus<X, Y> >
+ /// when< plus<X, Y> > // because of when<class X, class Y=X>
+ /// plus<X, Y> // because plus<> is both a
+ /// // grammar and a transform
+ /// \endcode
+ ///
+ /// For example, consider the following transform that promotes all
+ /// \c float terminals in an expression to \c double.
+ ///
+ /// \code
+ /// // This transform finds all float terminals in an expression and promotes
+ /// // them to doubles.
+ /// struct Promote
+ /// : or_<
+ /// when<terminal<float>, terminal<double>::type(_value) >
+ /// // terminal<>'s default transform is a no-op:
+ /// , terminal<_>
+ /// // nary_expr<> has a pass_through<> transform:
+ /// , nary_expr<_, vararg<Promote> >
+ /// >
+ /// {};
+ /// \endcode
+ template<typename Grammar>
+ struct pass_through
+ : transform<pass_through<Grammar> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<Grammar, Expr, State, Data>
+ {};
+ };
 
- typedef
- typename base_expr<
- typename unref_expr::proto_domain
- , typename unref_expr::proto_tag
- , BOOST_PP_CAT(list, N)<
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
- >
- >::type
- expr_type;
-
- typedef typename unref_expr::proto_generator proto_generator;
- typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
-
- result_type const operator ()(
- typename pass_through_impl::expr_param e
- , typename pass_through_impl::state_param s
- , typename pass_through_impl::data_param d
- ) const
- {
- expr_type const that = {
- BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
- };
- #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
- // Without this, MSVC complains that "that" is uninitialized,
- // and it actually triggers a runtime check in debug mode when
- // built with VC8.
- &that;
- #endif
- return proto_generator()(that);
- }
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar>
+ struct is_callable<pass_through<Grammar> >
+ : mpl::true_
+ {};
 
- #undef N
+}} // namespace boost::proto
 
 #endif

Modified: trunk/boost/proto/transform/when.hpp
==============================================================================
--- trunk/boost/proto/transform/when.hpp (original)
+++ trunk/boost/proto/transform/when.hpp 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -1,278 +1,197 @@
-#ifndef BOOST_PP_IS_ITERATING
- ///////////////////////////////////////////////////////////////////////////////
- /// \file when.hpp
- /// Definition of when 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_WHEN_HPP_EAN_10_29_2007
- #define BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
-
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
- #include <boost/preprocessor/iteration/iterate.hpp>
- #include <boost/mpl/at.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/map.hpp>
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/traits.hpp>
- #include <boost/proto/transform/call.hpp>
- #include <boost/proto/transform/make.hpp>
- #include <boost/proto/transform/impl.hpp>
-
- namespace boost { namespace proto
+///////////////////////////////////////////////////////////////////////////////
+/// \file when.hpp
+/// Definition of when 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_WHEN_HPP_EAN_10_29_2007
+#define BOOST_PROTO_TRANSFORM_WHEN_HPP_EAN_10_29_2007
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/map.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/call.hpp>
+#include <boost/proto/transform/make.hpp>
+#include <boost/proto/transform/impl.hpp>
+
+namespace boost { namespace proto
+{
+ /// \brief A grammar element and a PrimitiveTransform that associates
+ /// a transform with the grammar.
+ ///
+ /// Use <tt>when\<\></tt> to override a grammar's default transform
+ /// with a custom transform. It is for used when composing larger
+ /// transforms by associating smaller transforms with individual
+ /// rules in your grammar, as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// In <tt>when\<G, T\></tt>, when \c T is a class type it is a
+ /// PrimitiveTransform and the following equivalencies hold:
+ ///
+ /// <tt>boost::result_of\<when\<G,T\>(E,S,V)\>::type</tt> is the same as
+ /// <tt>boost::result_of\<T(E,S,V)\>::type</tt>.
+ ///
+ /// <tt>when\<G,T\>()(e,s,d)</tt> is the same as
+ /// <tt>T()(e,s,d)</tt>.
+ template<typename Grammar, typename PrimitiveTransform /*= Grammar*/>
+ struct when
+ : PrimitiveTransform
     {
- /// \brief A grammar element and a PrimitiveTransform that associates
- /// a transform with the grammar.
- ///
- /// Use <tt>when\<\></tt> to override a grammar's default transform
- /// with a custom transform. It is for used when composing larger
- /// transforms by associating smaller transforms with individual
- /// rules in your grammar, as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- ///
- /// In <tt>when\<G, T\></tt>, when \c T is a class type it is a
- /// PrimitiveTransform and the following equivalencies hold:
- ///
- /// <tt>boost::result_of\<when\<G,T\>(E,S,V)\>::type</tt> is the same as
- /// <tt>boost::result_of\<T(E,S,V)\>::type</tt>.
- ///
- /// <tt>when\<G,T\>()(e,s,d)</tt> is the same as
- /// <tt>T()(e,s,d)</tt>.
- template<typename Grammar, typename PrimitiveTransform /*= Grammar*/>
- struct when
- : PrimitiveTransform
- {
- typedef Grammar first;
- typedef PrimitiveTransform second;
- typedef typename Grammar::proto_grammar proto_grammar;
- };
-
- /// \brief A specialization that treats function pointer Transforms as
- /// if they were function type Transforms.
- ///
- /// This specialization requires that \c Fun is actually a function type.
- ///
- /// This specialization is required for nested transforms such as
- /// <tt>when\<G, T0(T1(_))\></tt>. In C++, functions that are used as
- /// parameters to other functions automatically decay to funtion
- /// pointer types. In other words, the type <tt>T0(T1(_))</tt> is
- /// indistinguishable from <tt>T0(T1(*)(_))</tt>. This specialization
- /// is required to handle these nested function pointer type transforms
- /// properly.
- template<typename Grammar, typename Fun>
- struct when<Grammar, Fun *>
- : when<Grammar, Fun>
- {};
-
- /// \brief Syntactic sugar for <tt>when\<_, Fun\></tt>, for use
- /// in grammars to handle all the cases not yet handled.
- ///
- /// Use <tt>otherwise\<T\></tt> in your grammars as a synonym for
- /// <tt>when\<_, T\></tt> as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- template<typename Fun>
- struct otherwise
- : when<_, Fun>
+ typedef Grammar first;
+ typedef PrimitiveTransform second;
+ typedef typename Grammar::proto_grammar proto_grammar;
+ };
+
+ /// \brief A specialization that treats function pointer Transforms as
+ /// if they were function type Transforms.
+ ///
+ /// This specialization requires that \c Fun is actually a function type.
+ ///
+ /// This specialization is required for nested transforms such as
+ /// <tt>when\<G, T0(T1(_))\></tt>. In C++, functions that are used as
+ /// parameters to other functions automatically decay to funtion
+ /// pointer types. In other words, the type <tt>T0(T1(_))</tt> is
+ /// indistinguishable from <tt>T0(T1(*)(_))</tt>. This specialization
+ /// is required to handle these nested function pointer type transforms
+ /// properly.
+ template<typename Grammar, typename Fun>
+ struct when<Grammar, Fun *>
+ : when<Grammar, Fun>
+ {};
+
+ /// \brief Syntactic sugar for <tt>when\<_, Fun\></tt>, for use
+ /// in grammars to handle all the cases not yet handled.
+ ///
+ /// Use <tt>otherwise\<T\></tt> in your grammars as a synonym for
+ /// <tt>when\<_, T\></tt> as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ template<typename Fun>
+ struct otherwise
+ : when<_, Fun>
+ {};
+
+ /// \brief This specialization uses the Data parameter as a collection
+ /// of transforms that can be indexed by the specified rule.
+ ///
+ /// Use <tt>when\<T, external_transform\></tt> in your code when you would like
+ /// to define a grammar once and use it to evaluate expressions with
+ /// many different sets of transforms. The transforms are found by
+ /// using the Data parameter as a map from rules to transforms.
+ ///
+ /// See \c action_map for an example.
+ template<typename Grammar>
+ struct when<Grammar, external_transform>
+ : proto::transform<when<Grammar, external_transform> >
+ {
+ typedef Grammar first;
+ typedef external_transform second;
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : Data::template when<Grammar>::template impl<Expr, State, Data>
         {};
 
- /// \brief This specialization uses the Data parameter as a collection
- /// of transforms that can be indexed by the specified rule.
- ///
- /// Use <tt>when\<T, external_transform\></tt> in your code when you would like
- /// to define a grammar once and use it to evaluate expressions with
- /// many different sets of transforms. The transforms are found by
- /// using the Data parameter as a map from rules to transforms.
- ///
- /// See \c action_map for an example.
- template<typename Grammar>
- struct when<Grammar, external_transform>
- : proto::transform<when<Grammar, external_transform> >
- {
- typedef Grammar first;
- typedef external_transform second;
- typedef typename Grammar::proto_grammar proto_grammar;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : Data::template when<Grammar>::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr, State, Data &>
- : Data::template when<Grammar>::template impl<Expr, State, Data &>
- {};
- };
-
- /// \brief For defining a map of Rule/Transform pairs for use with
- /// <tt>when\<T, external_transform\></tt> to make transforms external to the grammar
- ///
- /// The following code defines a grammar with a couple of external transforms.
- /// It also defines an action_map that maps from rules to transforms. It then
- /// passes that transforms map at the Data parameter to the grammar. In this way,
- /// the behavior of the grammar can be modified post-hoc by passing a different
- /// action_map.
- ///
- /// \code
- /// struct int_terminal
- /// : proto::terminal<int>
- /// {};
- ///
- /// struct char_terminal
- /// : proto::terminal<char>
- /// {};
- ///
- /// struct my_grammar
- /// : proto::or_<
- /// proto::when< int_terminal, proto::external_transform >
- /// , proto::when< char_terminal, proto::external_transform >
- /// , proto::when<
- /// proto::plus< my_grammar, my_grammar >
- /// , proto::fold< _, int(), my_grammar >
- /// >
- /// >
- /// {};
- ///
- /// struct my_transforms
- /// : proto::external_transforms<
- /// proto::when<int_terminal, print(proto::_value)>
- /// , proto::when<char_terminal, print(proto::_value)>
- /// >
- /// {};
- ///
- /// proto::literal<int> i(1);
- /// proto::literal<char> c('a');
- /// my_transforms trx;
- ///
- /// // Evaluate "i+c" using my_grammar with the specified transforms:
- /// my_grammar()(i + c, 0, trx);
- /// \endcode
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_MPL_LIMIT_MAP_SIZE, typename T, mpl::na)>
- struct external_transforms
- {
- typedef mpl::map<BOOST_PP_ENUM_PARAMS(BOOST_MPL_LIMIT_MAP_SIZE, T)> map_type;
-
- template<typename Rule>
- struct when
- : proto::when<_, typename mpl::at<map_type, Rule>::type>
- {};
- };
-
- #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/when.hpp>))
- #include BOOST_PP_ITERATE()
-
- /// INTERNAL ONLY
- ///
- template<typename Grammar, typename Transform>
- struct is_callable<when<Grammar, Transform> >
- : mpl::true_
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr, State, Data &>
+ : Data::template when<Grammar>::template impl<Expr, State, Data &>
         {};
+ };
 
- }} // namespace boost::proto
-
- #endif
+ /// \brief For defining a map of Rule/Transform pairs for use with
+ /// <tt>when\<T, external_transform\></tt> to make transforms external to the grammar
+ ///
+ /// The following code defines a grammar with a couple of external transforms.
+ /// It also defines an action_map that maps from rules to transforms. It then
+ /// passes that transforms map at the Data parameter to the grammar. In this way,
+ /// the behavior of the grammar can be modified post-hoc by passing a different
+ /// action_map.
+ ///
+ /// \code
+ /// struct int_terminal
+ /// : proto::terminal<int>
+ /// {};
+ ///
+ /// struct char_terminal
+ /// : proto::terminal<char>
+ /// {};
+ ///
+ /// struct my_grammar
+ /// : proto::or_<
+ /// proto::when< int_terminal, proto::external_transform >
+ /// , proto::when< char_terminal, proto::external_transform >
+ /// , proto::when<
+ /// proto::plus< my_grammar, my_grammar >
+ /// , proto::fold< _, int(), my_grammar >
+ /// >
+ /// >
+ /// {};
+ ///
+ /// struct my_transforms
+ /// : proto::external_transforms<
+ /// proto::when<int_terminal, print(proto::_value)>
+ /// , proto::when<char_terminal, print(proto::_value)>
+ /// >
+ /// {};
+ ///
+ /// proto::literal<int> i(1);
+ /// proto::literal<char> c('a');
+ /// my_transforms trx;
+ ///
+ /// // Evaluate "i+c" using my_grammar with the specified transforms:
+ /// my_grammar()(i + c, 0, trx);
+ /// \endcode
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_MPL_LIMIT_MAP_SIZE, typename T, mpl::na)>
+ struct external_transforms
+ {
+ typedef mpl::map<BOOST_PP_ENUM_PARAMS(BOOST_MPL_LIMIT_MAP_SIZE, T)> map_type;
 
-#else
+ template<typename Rule>
+ struct when
+ : proto::when<_, typename mpl::at<map_type, Rule>::type>
+ {};
+ };
 
- #define N BOOST_PP_ITERATION()
+ // Other specializations of proto::when are generated by the preprocessor...
+ #include <boost/proto/transform/detail/when.hpp>
 
- /// \brief A grammar element and a PrimitiveTransform that associates
- /// a transform with the grammar.
- ///
- /// Use <tt>when\<\></tt> to override a grammar's default transform
- /// with a custom transform. It is for used when composing larger
- /// transforms by associating smaller transforms with individual
- /// rules in your grammar, as in the following transform which
- /// counts the number of terminals in an expression.
- ///
- /// \code
- /// // Count the terminals in an expression tree.
- /// // Must be invoked with initial state == mpl::int_<0>().
- /// struct CountLeaves
- /// : or_<
- /// when<terminal<_>, mpl::next<_state>()>
- /// , otherwise<fold<_, _state, CountLeaves> >
- /// >
- /// {};
- /// \endcode
- ///
- /// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
- /// CallableTransform or an ObjectTransform as its second parameter.
- /// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
- /// distinguish between the two, and uses <tt>call\<\></tt> to
- /// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
- /// ObjectTransforms.
- template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
- {
- typedef Grammar first;
- typedef R second(BOOST_PP_ENUM_PARAMS(N, A));
- typedef typename Grammar::proto_grammar proto_grammar;
-
- // Note: do not evaluate is_callable<R> in this scope.
- // R may be an incomplete type at this point.
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- // OK to evaluate is_callable<R> here. R should be compete by now.
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
- , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
- >::type
- which;
-
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
- /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
- /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
- /// whether <tt>is_callable\<R\>::value</tt> is \c true or
- /// \c false.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
- /// \return <tt>which()(e, s, d)</tt>
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename Grammar, typename Transform>
+ struct is_callable<when<Grammar, Transform> >
+ : mpl::true_
+ {};
 
- #undef N
+}} // namespace boost::proto
 
 #endif

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-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -13,6 +13,7 @@
 #include <boost/proto/expr.hpp>
 #include <boost/proto/extends.hpp>
 #include <boost/proto/deep_copy.hpp>
+#include <boost/proto/domain.hpp>
 #include <boost/proto/generate.hpp>
 #include <boost/proto/make_expr.hpp>
 #include <boost/proto/matches.hpp>
@@ -21,3 +22,5 @@
 #include <boost/proto/transform/fold.hpp>
 #include <boost/proto/transform/lazy.hpp>
 #include <boost/proto/transform/make.hpp>
+#include <boost/proto/transform/pass_through.hpp>
+#include <boost/proto/transform/when.hpp>

Modified: trunk/libs/proto/preprocess/wave.cfg
==============================================================================
--- trunk/libs/proto/preprocess/wave.cfg (original)
+++ trunk/libs/proto/preprocess/wave.cfg 2011-05-08 13:56:58 EDT (Sun, 08 May 2011)
@@ -3,6 +3,12 @@
 -D_WIN32
 -NBOOST_STATIC_ASSERT
 -NBOOST_PROTO_TEMPLATE_ARITY_PARAM
+-NBOOST_PROTO_RESULT_OF
+-NBOOST_PROTO_DISABLE_IF_IS_CONST
+-NBOOST_PROTO_DISABLE_IF_IS_FUNCTION
+-NBOOST_PROTO_USE_GET_POINTER
+-NBOOST_PROTO_GET_POINTER
+-NBOOST_PROTO_ASSERT_VALID_DOMAIN
 -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