Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53419 - in trunk/boost/proto: . context detail transform
From: eric_at_[hidden]
Date: 2009-05-29 18:37:01


Author: eric_niebler
Date: 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
New Revision: 53419
URL: http://svn.boost.org/trac/boost/changeset/53419

Log:
low-hanging compile perf tweak to eliminate many unnecessary instantiations of term<> and listN<> templates
Text files modified:
   trunk/boost/proto/context/callable.hpp | 4
   trunk/boost/proto/deep_copy.hpp | 1
   trunk/boost/proto/detail/funop.hpp | 1
   trunk/boost/proto/expr.hpp | 48 +++++++++++++++---
   trunk/boost/proto/extends.hpp | 12 +++
   trunk/boost/proto/fusion.hpp | 4
   trunk/boost/proto/generate.hpp | 2
   trunk/boost/proto/literal.hpp | 4
   trunk/boost/proto/make_expr.hpp | 10 ++-
   trunk/boost/proto/operators.hpp | 54 ++++++++++----------
   trunk/boost/proto/traits.hpp | 104 ++++++++++++++++++++--------------------
   trunk/boost/proto/transform/pass_through.hpp | 1
   12 files changed, 145 insertions(+), 100 deletions(-)

Modified: trunk/boost/proto/context/callable.hpp
==============================================================================
--- trunk/boost/proto/context/callable.hpp (original)
+++ trunk/boost/proto/context/callable.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -209,8 +209,8 @@
                 /// <tt>DefaultCtx::eval\<Expr, Context\></tt>.
                 template<typename Expr, typename ThisContext = Context>
                 struct eval
- : mpl::if_<
- detail::is_expr_handled<Expr, Context>
+ : mpl::if_c<
+ detail::is_expr_handled<Expr, Context>::value
                       , callable_eval<Expr, ThisContext>
                       , typename DefaultCtx::template eval<Expr, Context>
>::type

Modified: trunk/boost/proto/deep_copy.hpp
==============================================================================
--- trunk/boost/proto/deep_copy.hpp (original)
+++ trunk/boost/proto/deep_copy.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -170,6 +170,7 @@
                       , BOOST_PP_CAT(list, N)<
                             BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
>
+ , N
>
                 expr_type;
 

Modified: trunk/boost/proto/detail/funop.hpp
==============================================================================
--- trunk/boost/proto/detail/funop.hpp (original)
+++ trunk/boost/proto/detail/funop.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -29,6 +29,7 @@
                 Expr &
                 BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), M0, ~)
>
+ , BOOST_PP_INC(BOOST_PP_ITERATION())
> type;
 
         static type const call(

Modified: trunk/boost/proto/expr.hpp
==============================================================================
--- trunk/boost/proto/expr.hpp (original)
+++ trunk/boost/proto/expr.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -43,7 +43,7 @@
         /// INTERNAL ONLY
         ///
         #define BOOST_PROTO_CHILD(Z, N, DATA) \
- typedef typename Args::BOOST_PP_CAT(child, N) BOOST_PP_CAT(proto_child, N); \
+ typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(proto_child, N); \
             BOOST_PP_CAT(proto_child, N) BOOST_PP_CAT(child, N); \
             /**< INTERNAL ONLY */
 
@@ -179,14 +179,27 @@
         ///
         /// \c proto::expr\<\> is a valid Fusion random-access sequence, where
         /// the elements of the sequence are the child expressions.
- template<typename Tag, typename Args>
- struct expr<Tag, Args, BOOST_PP_ITERATION() >
+
+ //template<typename Tag, typename Args>
+ //struct expr<Tag, Args, BOOST_PP_ITERATION() >
+
+ #if IS_TERMINAL
+ template<typename Tag, typename Arg0>
+ struct expr<Tag, term<Arg0>, 0>
+ #else
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(ARG_COUNT, typename Arg)>
+ struct expr<Tag, BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)>, BOOST_PP_ITERATION() >
+ #endif
         {
             typedef Tag proto_tag;
             BOOST_STATIC_CONSTANT(long, proto_arity_c = BOOST_PP_ITERATION());
             typedef mpl::long_<BOOST_PP_ITERATION() > proto_arity;
             typedef expr proto_base_expr;
- typedef Args proto_args;
+ #if IS_TERMINAL
+ typedef term<Arg0> proto_args;
+ #else
+ typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
+ #endif
             typedef default_domain proto_domain;
             BOOST_PROTO_FUSION_DEFINE_TAG(proto::tag::proto_expr)
             typedef expr proto_derived_expr;
@@ -281,12 +294,14 @@
             proto::expr<
                 proto::tag::assign
               , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
> const
             operator =(A &a) const
             {
                 proto::expr<
                     proto::tag::assign
                   , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -297,12 +312,14 @@
             proto::expr<
                 proto::tag::assign
               , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
> const
             operator =(A const &a) const
             {
                 proto::expr<
                     proto::tag::assign
                   , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -314,12 +331,14 @@
             proto::expr<
                 proto::tag::assign
               , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
> const
             operator =(A &a)
             {
                 proto::expr<
                     proto::tag::assign
                   , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -330,12 +349,14 @@
             proto::expr<
                 proto::tag::assign
               , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
> const
             operator =(A const &a)
             {
                 proto::expr<
                     proto::tag::assign
                   , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -349,12 +370,14 @@
             proto::expr<
                 proto::tag::subscript
               , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
> const
             operator [](A &a) const
             {
                 proto::expr<
                     proto::tag::subscript
                   , list2<expr const &, typename result_of::as_child<A>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -364,12 +387,15 @@
             template<typename A>
             proto::expr<
                 proto::tag::subscript
- , list2<expr const &, typename result_of::as_child<A const>::type> > const
+ , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
+ > const
             operator [](A const &a) const
             {
                 proto::expr<
                     proto::tag::subscript
                   , list2<expr const &, typename result_of::as_child<A const>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -381,12 +407,14 @@
             proto::expr<
                 proto::tag::subscript
               , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
> const
             operator [](A &a)
             {
                 proto::expr<
                     proto::tag::subscript
                   , list2<expr &, typename result_of::as_child<A>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -397,12 +425,14 @@
             proto::expr<
                 proto::tag::subscript
               , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
> const
             operator [](A const &a)
             {
                 proto::expr<
                     proto::tag::subscript
                   , list2<expr &, typename result_of::as_child<A const>::type>
+ , 2
> that = {*this, proto::as_child(a)};
                 return that;
             }
@@ -419,20 +449,20 @@
             /// Function call
             ///
             /// \return A new \c expr\<\> node representing the function invocation of \c (*this)().
- proto::expr<proto::tag::function, list1<expr const &> > const
+ proto::expr<proto::tag::function, list1<expr const &>, 1> const
             operator ()() const
             {
- proto::expr<proto::tag::function, list1<expr const &> > that = {*this};
+ proto::expr<proto::tag::function, list1<expr const &>, 1> that = {*this};
                 return that;
             }
 
         #if IS_TERMINAL
             /// \overload
             ///
- proto::expr<proto::tag::function, list1<expr &> > const
+ proto::expr<proto::tag::function, list1<expr &>, 1> const
             operator ()()
             {
- proto::expr<proto::tag::function, list1<expr &> > that = {*this};
+ proto::expr<proto::tag::function, list1<expr &>, 1> that = {*this};
                 return that;
             }
         #endif

Modified: trunk/boost/proto/extends.hpp
==============================================================================
--- trunk/boost/proto/extends.hpp (original)
+++ trunk/boost/proto/extends.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -200,6 +200,7 @@
                         proto_derived_expr BOOST_PROTO_CONST ## Const & \
                       , typename boost::proto::result_of::as_child<A, proto_domain>::type \
> \
+ , 2 \
> \
             ) \
>::type const \
@@ -211,6 +212,7 @@
                     proto_derived_expr BOOST_PROTO_CONST ## Const & \
                   , typename boost::proto::result_of::as_child<A, proto_domain>::type \
> \
+ , 2 \
> that_type; \
             that_type that = { \
                 *static_cast<proto_derived_expr BOOST_PROTO_CONST ## Const *>(this) \
@@ -228,6 +230,7 @@
                         proto_derived_expr BOOST_PROTO_CONST ## Const & \
                       , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
> \
+ , 2 \
> \
             ) \
>::type const \
@@ -239,6 +242,7 @@
                     proto_derived_expr BOOST_PROTO_CONST ## Const & \
                   , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
> \
+ , 2 \
> that_type; \
             that_type that = { \
                 *static_cast<proto_derived_expr BOOST_PROTO_CONST ## Const *>(this) \
@@ -271,6 +275,7 @@
                         proto_derived_expr BOOST_PROTO_CONST ## Const & \
                       , typename boost::proto::result_of::as_child<A, proto_domain>::type \
> \
+ , 2 \
> \
             ) \
>::type const \
@@ -282,6 +287,7 @@
                     proto_derived_expr BOOST_PROTO_CONST ## Const & \
                   , typename boost::proto::result_of::as_child<A, proto_domain>::type \
> \
+ , 2 \
> that_type; \
             that_type that = { \
                 *static_cast<proto_derived_expr BOOST_PROTO_CONST ## Const *>(this) \
@@ -299,6 +305,7 @@
                         proto_derived_expr BOOST_PROTO_CONST ## Const & \
                       , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
> \
+ , 2 \
> \
             ) \
>::type const \
@@ -310,6 +317,7 @@
                     proto_derived_expr BOOST_PROTO_CONST ## Const & \
                   , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
> \
+ , 2 \
> that_type; \
             that_type that = { \
                 *static_cast<proto_derived_expr BOOST_PROTO_CONST ## Const *>(this) \
@@ -534,7 +542,7 @@
     struct virtual_member
     {
         typedef
- expr<tag::member, list2<This &, expr<tag::terminal, term<Fun> > const &> >
+ expr<tag::member, list2<This &, expr<tag::terminal, term<Fun> > const &>, 2>
         proto_base_expr;
         typedef Domain proto_domain;
         typedef virtual_member<This, Fun, Domain> proto_derived_expr;
@@ -564,7 +572,7 @@
 
         proto_child1 child1() const
         {
- static expr<tag::terminal, term<Fun> > const that = {Fun()};
+ static expr<tag::terminal, term<Fun>, 0> const that = {Fun()};
             return that;
         }
     };

Modified: trunk/boost/proto/fusion.hpp
==============================================================================
--- trunk/boost/proto/fusion.hpp (original)
+++ trunk/boost/proto/fusion.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -103,8 +103,8 @@
 
             template<typename This, typename Expr>
             struct result<This(Expr)>
- : mpl::if_<
- is_same<Tag, UNREF(Expr)::proto_tag>
+ : mpl::if_c<
+ is_same<Tag, UNREF(Expr)::proto_tag>::value
                   , flat_view<UNREF(Expr) const>
                   , fusion::single_view<UNREF(Expr) const &>
>

Modified: trunk/boost/proto/generate.hpp
==============================================================================
--- trunk/boost/proto/generate.hpp (original)
+++ trunk/boost/proto/generate.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -56,6 +56,7 @@
                     proto::expr<
                         typename expr_params<Expr>::tag
                       , term<typename detail::term_traits<typename expr_params<Expr>::args::child0>::value_type>
+ , 0
>
                 type;
 
@@ -359,6 +360,7 @@
                             // typename uncvref<typename expr_params<Expr>::args::child0>::type, ...
                             BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_BY_VALUE_TYPE, Expr)
>
+ , N
>
                 type;
 

Modified: trunk/boost/proto/literal.hpp
==============================================================================
--- trunk/boost/proto/literal.hpp (original)
+++ trunk/boost/proto/literal.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -36,10 +36,10 @@
           , typename Domain BOOST_PROTO_WHEN_BUILDING_DOCS(= default_domain)
>
         struct literal
- : extends<expr<tag::terminal, term<T> >, literal<T, Domain>, Domain>
+ : extends<expr<tag::terminal, term<T>, 0>, literal<T, Domain>, Domain>
         {
         private:
- typedef expr<tag::terminal, term<T> > terminal_type;
+ typedef expr<tag::terminal, term<T>, 0> terminal_type;
             typedef extends<terminal_type, literal<T, Domain>, Domain> base_type;
 
         public:

Modified: trunk/boost/proto/make_expr.hpp
==============================================================================
--- trunk/boost/proto/make_expr.hpp (original)
+++ trunk/boost/proto/make_expr.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -174,8 +174,8 @@
                 unref_type;
 
                 typedef
- typename mpl::eval_if<
- boost::is_reference_wrapper<T>
+ typename mpl::eval_if_c<
+ boost::is_reference_wrapper<T>::value
                       , proto::result_of::as_child<unref_type, Domain>
                       , proto::result_of::as_expr<unref_type, Domain>
>::type
@@ -183,8 +183,8 @@
 
                 static type call(T &t)
                 {
- return typename mpl::if_<
- is_reference_wrapper<T>
+ return typename mpl::if_c<
+ is_reference_wrapper<T>::value
                       , functional::as_child<Domain>
                       , functional::as_expr<Domain>
>::type()(static_cast<unref_type &>(t));
@@ -976,6 +976,7 @@
             typedef proto::expr<
                 Tag
               , BOOST_PP_CAT(list, N)<BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain)) >
+ , N
> expr_type;
 
             typedef typename Domain::template result<void(expr_type)>::type result_type;
@@ -1009,6 +1010,7 @@
               , BOOST_PP_CAT(list, N)<
                     BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT_TYPE, ~)
>
+ , N
> expr_type;
 
             typedef typename Domain::template result<void(expr_type)>::type type;

Modified: trunk/boost/proto/operators.hpp
==============================================================================
--- trunk/boost/proto/operators.hpp (original)
+++ trunk/boost/proto/operators.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -46,9 +46,9 @@
         template<typename Domain, typename Tag, typename Left, typename Right>
         struct generate_if_left
           : lazy_enable_if_c<
- matches<proto::expr<Tag, proto::list2<Left &, Right> >, typename Domain::proto_grammar>::value
+ matches<proto::expr<Tag, proto::list2<Left &, Right>, 2>, typename Domain::proto_grammar>::value
               , typename Domain::template result<void(
- proto::expr<Tag, proto::list2<Left &, typename Domain::template result<void(Right)>::type> >
+ proto::expr<Tag, proto::list2<Left &, typename Domain::template result<void(Right)>::type>, 2>
                 )>
>
         {};
@@ -57,15 +57,15 @@
         template<typename Tag, typename Left, typename Right>
         struct generate_if_left<proto::default_domain, Tag, Left, Right>
         {
- typedef proto::expr<Tag, proto::list2<Left &, Right> > type;
+ typedef proto::expr<Tag, proto::list2<Left &, Right>, 2> type;
         };
 
         template<typename Domain, typename Tag, typename Left, typename Right>
         struct generate_if_right
           : lazy_enable_if_c<
- matches<proto::expr<Tag, proto::list2<Left, Right &> >, typename Domain::proto_grammar>::value
+ matches<proto::expr<Tag, proto::list2<Left, Right &>, 2>, typename Domain::proto_grammar>::value
               , typename Domain::template result<void(
- proto::expr<Tag, proto::list2<typename Domain::template result<void(Left)>::type, Right &> >
+ proto::expr<Tag, proto::list2<typename Domain::template result<void(Left)>::type, Right &>, 2>
                 )>
>
         {};
@@ -74,7 +74,7 @@
         template<typename Tag, typename Left, typename Right>
         struct generate_if_right<proto::default_domain, Tag, Left, Right>
         {
- typedef proto::expr<Tag, proto::list2<Left, Right &> > type;
+ typedef proto::expr<Tag, proto::list2<Left, Right &>, 2> type;
         };
 
         template<typename Tag, typename Left, typename Right, typename Enable1 = void, typename Enable2 = void>
@@ -87,11 +87,11 @@
                 typename Left::proto_domain
               , Tag
               , Left
- , proto::expr<tag::terminal, term<Right &> >
+ , proto::expr<tag::terminal, term<Right &>, 0>
>
         {
- typedef proto::expr<tag::terminal, term<Right &> > term_type;
- typedef proto::expr<Tag, list2<Left &, typename Left::proto_domain::template result<void(term_type)>::type> > expr_type;
+ typedef proto::expr<tag::terminal, term<Right &>, 0> term_type;
+ typedef proto::expr<Tag, list2<Left &, typename Left::proto_domain::template result<void(term_type)>::type>, 2> expr_type;
 
             static typename Left::proto_domain::template result<void(expr_type)>::type
             make(Left &left, Right &right)
@@ -107,12 +107,12 @@
           : generate_if_right<
                 typename Right::proto_domain
               , Tag
- , proto::expr<tag::terminal, term<Left &> >
+ , proto::expr<tag::terminal, term<Left &>, 0>
               , Right
>
         {
- typedef proto::expr<tag::terminal, term<Left &> > term_type;
- typedef proto::expr<Tag, list2<typename Right::proto_domain::template result<void(term_type)>::type, Right &> > expr_type;
+ typedef proto::expr<tag::terminal, term<Left &>, 0> term_type;
+ typedef proto::expr<Tag, list2<typename Right::proto_domain::template result<void(term_type)>::type, Right &>, 2> expr_type;
 
             static typename Right::proto_domain::template result<void(expr_type)>::type
             make(Left &left, Right &right)
@@ -132,10 +132,10 @@
         struct as_expr_if<Tag, Left, Right, typename Left::proto_is_expr_, typename Right::proto_is_expr_>
           : generate_if<
                 typename Left::proto_domain
- , proto::expr<Tag, list2<Left &, Right &> >
+ , proto::expr<Tag, list2<Left &, Right &>, 2>
>
         {
- typedef proto::expr<Tag, list2<Left &, Right &> > expr_type;
+ typedef proto::expr<Tag, list2<Left &, Right &>, 2> expr_type;
             BOOST_MPL_ASSERT((is_same<typename Left::proto_domain, typename Right::proto_domain>));
 
             static typename Left::proto_domain::template result<void(expr_type)>::type
@@ -160,46 +160,46 @@
 
         template<typename Domain, typename Trait, typename Arg, typename Expr>
         struct enable_unary
- : boost::enable_if<
- boost::mpl::and_<Trait, boost::proto::matches<Expr, typename Domain::proto_grammar> >
+ : boost::enable_if_c<
+ boost::mpl::and_<Trait, boost::proto::matches<Expr, typename Domain::proto_grammar> >::value
               , Expr
>
         {};
 
         template<typename Trait, typename Arg, typename Expr>
         struct enable_unary<deduce_domain, Trait, Arg, Expr>
- : boost::enable_if<
+ : boost::enable_if_c<
                 boost::mpl::and_<
                     Trait
                   , boost::proto::matches<Expr, typename domain_of<Arg>::type::proto_grammar>
- >
+ >::value
               , Expr
>
         {};
 
         template<typename Trait, typename Arg, typename Expr>
         struct enable_unary<default_domain, Trait, Arg, Expr>
- : boost::enable_if<Trait, Expr>
+ : boost::enable_if_c<Trait::value, Expr>
         {};
 
         template<typename Domain, typename Trait1, typename Arg1, typename Trait2, typename Arg2, typename Expr>
         struct enable_binary
- : boost::enable_if<
+ : boost::enable_if_c<
                 boost::mpl::and_<
                     mpl::bool_<(3 <= (arg_weight<Arg1, Trait1>::value + arg_weight<Arg2, Trait2>::value))>
                   , boost::proto::matches<Expr, typename Domain::proto_grammar>
- >
+ >::value
               , Expr
>
         {};
 
         template<typename Trait1, typename Arg1, typename Trait2, typename Arg2, typename Expr>
         struct enable_binary<deduce_domain, Trait1, Arg1, Trait2, Arg2, Expr>
- : boost::enable_if<
+ : boost::enable_if_c<
                 boost::mpl::and_<
                     mpl::bool_<(3 <= (arg_weight<Arg1, Trait1>::value + arg_weight<Arg2, Trait2>::value))>
                   , boost::proto::matches<Expr, typename deduce_domain2<Arg1, Arg2>::type::proto_grammar>
- >
+ >::value
               , Expr
>
         {};
@@ -221,22 +221,22 @@
     template<typename Arg> \
     typename detail::generate_if< \
         typename Arg::proto_domain \
- , proto::expr<TAG, list1<typename Arg::proto_derived_expr &> > \
+ , proto::expr<TAG, list1<typename Arg::proto_derived_expr &>, 1> \
>::type const \
     operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- typedef proto::expr<TAG, list1<typename Arg::proto_derived_expr &> > that_type; \
+ typedef proto::expr<TAG, list1<typename Arg::proto_derived_expr &>, 1> that_type; \
         that_type that = {arg}; \
         return typename Arg::proto_domain()(that); \
     } \
     template<typename Arg> \
     typename detail::generate_if< \
         typename Arg::proto_domain \
- , proto::expr<TAG, list1<typename Arg::proto_derived_expr const &> > \
+ , proto::expr<TAG, list1<typename Arg::proto_derived_expr const &>, 1> \
>::type const \
     operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- typedef proto::expr<TAG, list1<typename Arg::proto_derived_expr const &> > that_type; \
+ typedef proto::expr<TAG, list1<typename Arg::proto_derived_expr const &>, 1> that_type; \
         that_type that = {arg}; \
         return typename Arg::proto_domain()(that); \
     } \

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -257,7 +257,7 @@
                       , remove_cv<T>
>::type
                 arg0_;
- typedef proto::expr<proto::tag::terminal, term<arg0_> > expr_;
+ typedef proto::expr<proto::tag::terminal, term<arg0_>, 0> expr_;
                 typedef typename Domain::template result<void(expr_)>::type type;
                 typedef type const reference;
 
@@ -345,7 +345,7 @@
>
             struct as_child
             {
- typedef proto::expr<proto::tag::terminal, term<T &> > expr_;
+ typedef proto::expr<proto::tag::terminal, term<T &>, 0> expr_;
                 typedef typename Domain::template result<void(expr_)>::type type;
 
                 /// INTERNAL ONLY
@@ -531,7 +531,7 @@
             template<typename T>
             struct terminal : transform<terminal<T>, empty_base>
             {
- typedef proto::expr<proto::tag::terminal, term<T> > type;
+ typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -571,7 +571,7 @@
             template<typename T, typename U, typename V>
             struct if_else_ : transform<if_else_<T, U, V>, empty_base>
             {
- typedef proto::expr<proto::tag::if_else_, list3<T, U, V> > type;
+ typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -599,7 +599,7 @@
             template<typename Tag, typename T>
             struct nullary_expr : transform<nullary_expr<Tag, T>, empty_base>
             {
- typedef proto::expr<Tag, term<T> > type;
+ typedef proto::expr<Tag, term<T>, 0> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -643,7 +643,7 @@
             template<typename Tag, typename T>
             struct unary_expr : transform<unary_expr<Tag, T>, empty_base>
             {
- typedef proto::expr<Tag, list1<T> > type;
+ typedef proto::expr<Tag, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -668,7 +668,7 @@
             template<typename Tag, typename T, typename U>
             struct binary_expr : transform<binary_expr<Tag, T, U>, empty_base>
             {
- typedef proto::expr<Tag, list2<T, U> > type;
+ typedef proto::expr<Tag, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -691,7 +691,7 @@
             template<typename T>
             struct unary_plus : transform<unary_plus<T>, empty_base>
             {
- typedef proto::expr<proto::tag::unary_plus, list1<T> > type;
+ typedef proto::expr<proto::tag::unary_plus, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -712,7 +712,7 @@
             template<typename T>
             struct negate : transform<negate<T>, empty_base>
             {
- typedef proto::expr<proto::tag::negate, list1<T> > type;
+ typedef proto::expr<proto::tag::negate, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -733,7 +733,7 @@
             template<typename T>
             struct dereference : transform<dereference<T>, empty_base>
             {
- typedef proto::expr<proto::tag::dereference, list1<T> > type;
+ typedef proto::expr<proto::tag::dereference, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -754,7 +754,7 @@
             template<typename T>
             struct complement : transform<complement<T>, empty_base>
             {
- typedef proto::expr<proto::tag::complement, list1<T> > type;
+ typedef proto::expr<proto::tag::complement, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -775,7 +775,7 @@
             template<typename T>
             struct address_of : transform<address_of<T>, empty_base>
             {
- typedef proto::expr<proto::tag::address_of, list1<T> > type;
+ typedef proto::expr<proto::tag::address_of, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -796,7 +796,7 @@
             template<typename T>
             struct logical_not : transform<logical_not<T>, empty_base>
             {
- typedef proto::expr<proto::tag::logical_not, list1<T> > type;
+ typedef proto::expr<proto::tag::logical_not, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -817,7 +817,7 @@
             template<typename T>
             struct pre_inc : transform<pre_inc<T>, empty_base>
             {
- typedef proto::expr<proto::tag::pre_inc, list1<T> > type;
+ typedef proto::expr<proto::tag::pre_inc, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -838,7 +838,7 @@
             template<typename T>
             struct pre_dec : transform<pre_dec<T>, empty_base>
             {
- typedef proto::expr<proto::tag::pre_dec, list1<T> > type;
+ typedef proto::expr<proto::tag::pre_dec, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -859,7 +859,7 @@
             template<typename T>
             struct post_inc : transform<post_inc<T>, empty_base>
             {
- typedef proto::expr<proto::tag::post_inc, list1<T> > type;
+ typedef proto::expr<proto::tag::post_inc, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -880,7 +880,7 @@
             template<typename T>
             struct post_dec : transform<post_dec<T>, empty_base>
             {
- typedef proto::expr<proto::tag::post_dec, list1<T> > type;
+ typedef proto::expr<proto::tag::post_dec, list1<T>, 1> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -901,7 +901,7 @@
             template<typename T, typename U>
             struct shift_left : transform<shift_left<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::shift_left, list2<T, U> > type;
+ typedef proto::expr<proto::tag::shift_left, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -924,7 +924,7 @@
             template<typename T, typename U>
             struct shift_right : transform<shift_right<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::shift_right, list2<T, U> > type;
+ typedef proto::expr<proto::tag::shift_right, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -947,7 +947,7 @@
             template<typename T, typename U>
             struct multiplies : transform<multiplies<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::multiplies, list2<T, U> > type;
+ typedef proto::expr<proto::tag::multiplies, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -970,7 +970,7 @@
             template<typename T, typename U>
             struct divides : transform<divides<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::divides, list2<T, U> > type;
+ typedef proto::expr<proto::tag::divides, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -993,7 +993,7 @@
             template<typename T, typename U>
             struct modulus : transform<modulus<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::modulus, list2<T, U> > type;
+ typedef proto::expr<proto::tag::modulus, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1016,7 +1016,7 @@
             template<typename T, typename U>
             struct plus : transform<plus<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::plus, list2<T, U> > type;
+ typedef proto::expr<proto::tag::plus, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1039,7 +1039,7 @@
             template<typename T, typename U>
             struct minus : transform<minus<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::minus, list2<T, U> > type;
+ typedef proto::expr<proto::tag::minus, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1062,7 +1062,7 @@
             template<typename T, typename U>
             struct less : transform<less<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::less, list2<T, U> > type;
+ typedef proto::expr<proto::tag::less, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1085,7 +1085,7 @@
             template<typename T, typename U>
             struct greater : transform<greater<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::greater, list2<T, U> > type;
+ typedef proto::expr<proto::tag::greater, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1108,7 +1108,7 @@
             template<typename T, typename U>
             struct less_equal : transform<less_equal<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::less_equal, list2<T, U> > type;
+ typedef proto::expr<proto::tag::less_equal, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1131,7 +1131,7 @@
             template<typename T, typename U>
             struct greater_equal : transform<greater_equal<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::greater_equal, list2<T, U> > type;
+ typedef proto::expr<proto::tag::greater_equal, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1154,7 +1154,7 @@
             template<typename T, typename U>
             struct equal_to : transform<equal_to<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::equal_to, list2<T, U> > type;
+ typedef proto::expr<proto::tag::equal_to, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1177,7 +1177,7 @@
             template<typename T, typename U>
             struct not_equal_to : transform<not_equal_to<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::not_equal_to, list2<T, U> > type;
+ typedef proto::expr<proto::tag::not_equal_to, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1200,7 +1200,7 @@
             template<typename T, typename U>
             struct logical_or : transform<logical_or<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::logical_or, list2<T, U> > type;
+ typedef proto::expr<proto::tag::logical_or, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1223,7 +1223,7 @@
             template<typename T, typename U>
             struct logical_and : transform<logical_and<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::logical_and, list2<T, U> > type;
+ typedef proto::expr<proto::tag::logical_and, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1246,7 +1246,7 @@
             template<typename T, typename U>
             struct bitwise_and : transform<bitwise_and<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_and, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_and, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1269,7 +1269,7 @@
             template<typename T, typename U>
             struct bitwise_or : transform<bitwise_or<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_or, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_or, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1292,7 +1292,7 @@
             template<typename T, typename U>
             struct bitwise_xor : transform<bitwise_xor<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_xor, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_xor, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1315,7 +1315,7 @@
             template<typename T, typename U>
             struct comma : transform<comma<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::comma, list2<T, U> > type;
+ typedef proto::expr<proto::tag::comma, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1334,7 +1334,7 @@
             template<typename T, typename U>
             struct mem_ptr : transform<mem_ptr<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::mem_ptr, list2<T, U> > type;
+ typedef proto::expr<proto::tag::mem_ptr, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1357,7 +1357,7 @@
             template<typename T, typename U>
             struct assign : transform<assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1380,7 +1380,7 @@
             template<typename T, typename U>
             struct shift_left_assign : transform<shift_left_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::shift_left_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::shift_left_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1403,7 +1403,7 @@
             template<typename T, typename U>
             struct shift_right_assign : transform<shift_right_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::shift_right_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::shift_right_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1426,7 +1426,7 @@
             template<typename T, typename U>
             struct multiplies_assign : transform<multiplies_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::multiplies_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::multiplies_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1449,7 +1449,7 @@
             template<typename T, typename U>
             struct divides_assign : transform<divides_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::divides_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::divides_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1472,7 +1472,7 @@
             template<typename T, typename U>
             struct modulus_assign : transform<modulus_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::modulus_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::modulus_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1495,7 +1495,7 @@
             template<typename T, typename U>
             struct plus_assign : transform<plus_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::plus_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::plus_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1518,7 +1518,7 @@
             template<typename T, typename U>
             struct minus_assign : transform<minus_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::minus_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::minus_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1541,7 +1541,7 @@
             template<typename T, typename U>
             struct bitwise_and_assign : transform<bitwise_and_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_and_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_and_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1564,7 +1564,7 @@
             template<typename T, typename U>
             struct bitwise_or_assign : transform<bitwise_or_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_or_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_or_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1587,7 +1587,7 @@
             template<typename T, typename U>
             struct bitwise_xor_assign : transform<bitwise_xor_assign<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::bitwise_xor_assign, list2<T, U> > type;
+ typedef proto::expr<proto::tag::bitwise_xor_assign, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1610,7 +1610,7 @@
             template<typename T, typename U>
             struct subscript : transform<subscript<T, U>, empty_base>
             {
- typedef proto::expr<proto::tag::subscript, list2<T, U> > type;
+ typedef proto::expr<proto::tag::subscript, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -1633,7 +1633,7 @@
             template<typename T, typename U>
             struct member : transform<member<T, U>, empty_base>
             {
- typedef expr<tag::member, list2<T, U> > type;
+ typedef expr<tag::member, list2<T, U>, 2> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -2276,7 +2276,7 @@
                   , empty_base
>
             {
- typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
+ typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>
@@ -2321,7 +2321,7 @@
                   , empty_base
>
             {
- typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
+ typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
                 typedef type proto_base_expr;
 
                 template<typename Expr, typename State, typename Data>

Modified: trunk/boost/proto/transform/pass_through.hpp
==============================================================================
--- trunk/boost/proto/transform/pass_through.hpp (original)
+++ trunk/boost/proto/transform/pass_through.hpp 2009-05-29 18:36:59 EDT (Fri, 29 May 2009)
@@ -170,6 +170,7 @@
                   , BOOST_PP_CAT(list, N)<
                         BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
>
+ , N
> result_type;
 
                 result_type operator ()(


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