Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9531/boost/xpressive/proto
Modified Files:
matches.hpp
Log Message:
allow meta::binary_expr<mpl::_, Grammar, Grammar> to match any binary
expression, lambda example supports evaluation of nullary lambdas
Index: matches.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/matches.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- matches.hpp 28 Dec 2006 02:37:27 -0000 1.22
+++ matches.hpp 31 Dec 2006 07:22:13 -0000 1.23
@@ -172,6 +172,14 @@
>
{};
+ template<typename Tag, typename Args1, typename Args2>
+ struct matches_impl< expr<Tag, Args1, 1>, expr<mpl::_, Args2, 1> >
+ : matches_impl<
+ typename Args1::arg0::type
+ , typename deref<typename Args2::arg0>::type
+ >
+ {};
+
template<typename Args1, typename Args2>
struct matches_impl< expr<tag::terminal, Args1, 1>,
expr<tag::terminal, Args2, 1> >
: terminal_matches<
@@ -180,6 +188,14 @@
>
{};
+ template<typename Args1, typename Args2>
+ struct matches_impl< expr<tag::terminal, Args1, 1>, expr<mpl::_,
Args2, 1> >
+ : terminal_matches<
+ typename Args1::arg0
+ , typename Args2::arg0
+ >
+ {};
+
#define BOOST_PROTO_MATCHES_N_FUN(z, n, data)\
matches_impl<\
typename Args1::BOOST_PP_CAT(arg, n)::type\
@@ -294,6 +310,11 @@
: detail::and_<BOOST_PP_ENUM(N, BOOST_PROTO_MATCHES_N_FUN, N) >
{};
+ template<typename Tag, typename Args1, typename Args2>
+ struct matches_impl< expr<Tag, Args1, N>, expr<mpl::_, Args2, N> >
+ : detail::and_<BOOST_PP_ENUM(N, BOOST_PROTO_MATCHES_N_FUN, N) >
+ {};
+
// 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)> >
-------------------------------------------------------------------------
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