Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51068 - trunk/boost/proto
From: eric_at_[hidden]
Date: 2009-02-06 20:09:57


Author: eric_niebler
Date: 2009-02-06 20:09:57 EST (Fri, 06 Feb 2009)
New Revision: 51068
URL: http://svn.boost.org/trac/boost/changeset/51068

Log:
eliminate extra dummy template parameter from proto::function and proto::nary_expr
Text files modified:
   trunk/boost/proto/proto_fwd.hpp | 4 ++--
   trunk/boost/proto/traits.hpp | 18 ++++++++++++------
   2 files changed, 14 insertions(+), 8 deletions(-)

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2009-02-06 20:09:57 EST (Fri, 06 Feb 2009)
@@ -478,7 +478,7 @@
         template<typename Tag, typename Left, typename Right>
         struct binary_expr;
 
- template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void), typename Dummy = void>
+ template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
         struct nary_expr;
 
         // Specific expression metafunctions and
@@ -531,7 +531,7 @@
         template<typename T, typename U> struct member;
         template<typename T, typename U, typename V> struct if_else_;
 
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void), typename Dummy = void>
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
         struct function;
     }
 

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2009-02-06 20:09:57 EST (Fri, 06 Feb 2009)
@@ -2261,14 +2261,17 @@
             /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
             /// transform.
             template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- struct function<
+ struct function
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
                 BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
+ #endif
               : transform<
                     function<
                         BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
                   , empty_base
>
@@ -2301,16 +2304,19 @@
             /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
             /// n-ary expression; that is, any non-terminal.
             template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct nary_expr<
+ struct nary_expr
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
                 Tag
                 BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
+ #endif
               : transform<
                     nary_expr<
                         Tag
                         BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
                   , empty_base
>


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