Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2891/proto

Modified Files:
        extends.hpp matches.hpp proto_fwd.hpp 
Log Message:
BOOST_PROTO_MAX_LOGICAL_ARITY is 8

Index: extends.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/extends.hpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- extends.hpp 15 Feb 2007 23:06:56 -0000      1.23
+++ extends.hpp 22 Feb 2007 00:55:43 -0000      1.24
@@ -188,9 +188,26 @@
         /**/
 
     /// \brief Empty type to be used as a dummy template parameter of
-    ///     POD expression wrappers. It allows argument-dependent look-up
+    ///     POD expression wrappers. It allows argument-dependent lookup
     ///     to find proto's operator overloads.
     ///
+    /// For example:
+    ///
+    ///     template< typename T, typename Dummy = proto::is_proto_expr >
+    ///     struct my_terminal
+    ///     {
+    ///         BOOST_PROTO_EXTENDS(
+    ///             typename proto::terminal<T>::type
+    ///           , my_terminal<T>
+    ///           , default_domain
+    ///         )
+    ///     };
+    ///
+    ///     my_terminal<int> _1, _2;
+    ///     _1 + _2; // OK, uses proto::operator+
+    ///
+    /// Without the second Dummy template parameter, Proto's operator 
+    /// overloads would not be considered by name lookup.
     struct is_proto_expr
     {};
 

Index: matches.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/matches.hpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- matches.hpp 3 Feb 2007 23:48:48 -0000       1.36
+++ matches.hpp 22 Feb 2007 00:55:43 -0000      1.37
@@ -212,8 +212,10 @@
               , BOOST_PP_CAT(Grammar, n)\
             >
 
-        #define BOOST_PP_ITERATION_PARAMS_1 (3, (2, BOOST_PROTO_MAX_ARITY, 
<boost/xpressive/proto/matches.hpp>))
+        #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, 
BOOST_PROTO_MAX_LOGICAL_ARITY, <boost/xpressive/proto/matches.hpp>, 1))
+        #include BOOST_PP_ITERATE()
 
+        #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, BOOST_PROTO_MAX_ARITY, 
<boost/xpressive/proto/matches.hpp>, 2))
         #include BOOST_PP_ITERATE()
 
         #undef BOOST_PROTO_MATCHES_N_FUN
@@ -233,7 +235,7 @@
           : detail::matches_impl<typename Expr::type, typename Grammar::type>
         {};
 
-        template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename G)>
+        template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename 
G)>
         struct or_
         {
             typedef or_ type;
@@ -254,7 +256,7 @@
             }
         };
 
-        template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename G)>
+        template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename 
G)>
         struct and_
         {
             typedef and_ type;
@@ -310,7 +312,7 @@
 
     #endif
 
-#else
+#elif BOOST_PP_ITERATION_FLAGS() == 1
 
     #define N BOOST_PP_ITERATION()
 
@@ -348,6 +350,30 @@
               : mpl::false_
             {};
 
+            // handle proto::or_
+            template<typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
+            struct matches_impl<Expr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
+              : BOOST_PP_CAT(or, N)<
+                    matches_impl<typename Expr::type, typename 
G0::type>::value,
+                    typename Expr::type, BOOST_PP_ENUM_PARAMS(N, G)
+                >
+            {};
+
+            // handle proto::and_
+            template<typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
+            struct matches_impl<Expr, proto::and_<BOOST_PP_ENUM_PARAMS(N, G)> >
+              : detail::BOOST_PP_CAT(and, N)<
+                    BOOST_PROTO_DEFINE_MATCHES(~, 0, ~)::value,
+                    BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_MATCHES, ~)
+                >
+            {};
+
+    #undef N
+
+#elif BOOST_PP_ITERATION_FLAGS() == 2
+
+    #define N BOOST_PP_ITERATION()
+
             template<typename Args, typename Back, long To>
             struct vararg_matches_impl<Args, Back, N, To>
               : and2<
@@ -389,24 +415,6 @@
                 >
             {};
 
-            // handle proto::or_
-            template<typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
-            struct matches_impl<Expr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
-              : BOOST_PP_CAT(or, N)<
-                    matches_impl<typename Expr::type, typename 
G0::type>::value,
-                    typename Expr::type, BOOST_PP_ENUM_PARAMS(N, G)
-                >
-            {};
-
-            // handle proto::and_
-            template<typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
-            struct matches_impl<Expr, proto::and_<BOOST_PP_ENUM_PARAMS(N, G)> >
-              : detail::BOOST_PP_CAT(and, N)<
-                    BOOST_PROTO_DEFINE_MATCHES(~, 0, ~)::value,
-                    BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_MATCHES, ~)
-                >
-            {};
-
     #undef N
 
 #endif

Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_fwd.hpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- proto_fwd.hpp       14 Feb 2007 08:03:07 -0000      1.52
+++ proto_fwd.hpp       22 Feb 2007 00:55:44 -0000      1.53
@@ -24,6 +24,10 @@
 # define BOOST_PROTO_MAX_ARITY 5
 #endif
 
+#ifndef BOOST_PROTO_MAX_LOGICAL_ARITY
+# define BOOST_PROTO_MAX_LOGICAL_ARITY 8
+#endif
+
 #if BOOST_WORKAROUND(__GNUC__, == 3)
 # define BOOST_PROTO_BROKEN_CONST_OVERLOADS
 #endif
@@ -211,14 +215,14 @@
     template<
         typename Grammar0
       , typename Grammar1
-      , 
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY,2), 
typename G, void)
+      , 
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_SUB(BOOST_PROTO_MAX_LOGICAL_ARITY,2),
 typename G, void)
     >
     struct or_;
 
     template<
         typename Grammar0
       , typename Grammar1
-      , 
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY,2), 
typename G, void)
+      , 
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_SUB(BOOST_PROTO_MAX_LOGICAL_ARITY,2),
 typename G, void)
     >
     struct and_;
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to