1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
3 #include <boost/proto/detail/preprocessed/matches_.hpp>
5 #elif !defined(BOOST_PP_IS_ITERATING)
7 #define BOOST_PROTO_MATCHES_N_FUN(Z, N, DATA) \
9 typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_derived_expr \
10 , typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_grammar \
11 , typename Args2::BOOST_PP_CAT(child, N)::proto_grammar \
14 #define BOOST_PROTO_DEFINE_MATCHES(Z, N, DATA) \
18 , typename BOOST_PP_CAT(G, N)::proto_grammar \
21 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
22 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/matches_.hpp")
25 ///////////////////////////////////////////////////////////////////////////////
26 /// \file matches_.hpp
27 /// Definitions of matches_ specializations
29 // Copyright 2008 Eric Niebler. Distributed under the Boost
30 // Software License, Version 1.0. (See accompanying file
31 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
33 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
34 #pragma wave option(preserve: 1)
37 #define BOOST_PP_ITERATION_PARAMS_1 \
38 (3, (2, BOOST_PP_MAX(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_MAX_LOGICAL_ARITY), <boost/proto/detail/matches_.hpp>))
39 #include BOOST_PP_ITERATE()
41 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
42 #pragma wave option(output: null)
45 #undef BOOST_PROTO_DEFINE_MATCHES
46 #undef BOOST_PROTO_MATCHES_N_FUN
48 #else // BOOST_PP_IS_ITERATING
50 #define N BOOST_PP_ITERATION()
52 #if N <= BOOST_PROTO_MAX_LOGICAL_ARITY
55 template<typename Expr, typename BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, typename G)>
56 struct matches_<Expr, BasicExpr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
57 : BOOST_PP_CAT(or_, N)<
58 matches_<Expr, BasicExpr, typename G0::proto_grammar>::value,
59 Expr, BasicExpr BOOST_PP_ENUM_TRAILING_PARAMS(N, G)
64 template<typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>
65 struct matches_<Expr, BasicExpr, proto::and_<BOOST_PP_ENUM_PARAMS(N, G)> >
66 : detail::BOOST_PP_CAT(and_, N)<
67 BOOST_PROTO_DEFINE_MATCHES(~, 0, ~)::value,
68 BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_MATCHES, ~)
74 #if N <= BOOST_PROTO_MAX_ARITY
76 template<typename Expr, typename Tag, typename Args1, typename Args2>
77 struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<Tag, Args2, N> >
78 : BOOST_PP_CAT(and_, N)<
79 BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
80 BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
84 template<typename Expr, typename Tag, typename Args1, typename Args2>
85 struct matches_< Expr, proto::basic_expr<Tag, Args1, N>, proto::basic_expr<proto::_, Args2, N> >
86 : BOOST_PP_CAT(and_, N)<
87 BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
88 BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)