lambda_matches.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/detail/preprocessed/lambda_matches.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #define BOOST_PROTO_DEFINE_LAMBDA_MATCHES(Z, N, DATA) \
  5. lambda_matches< \
  6. BOOST_PP_CAT(Expr, N) \
  7. , BOOST_PP_CAT(Grammar, N) \
  8. >
  9. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  10. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/lambda_matches.hpp")
  11. #endif
  12. ///////////////////////////////////////////////////////////////////////////////
  13. /// \file lambda_matches.hpp
  14. /// Specializations of the lambda_matches template
  15. //
  16. // Copyright 2008 Eric Niebler. Distributed under the Boost
  17. // Software License, Version 1.0. (See accompanying file
  18. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  19. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  20. #pragma wave option(preserve: 1)
  21. #endif
  22. #define BOOST_PP_ITERATION_PARAMS_1 \
  23. (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/lambda_matches.hpp>))
  24. #include BOOST_PP_ITERATE()
  25. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  26. #pragma wave option(output: null)
  27. #endif
  28. #undef BOOST_PROTO_DEFINE_LAMBDA_MATCHES
  29. #else // BOOST_PP_IS_ITERATING
  30. #define N BOOST_PP_ITERATION()
  31. template<
  32. template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
  33. BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Expr)
  34. BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Grammar)
  35. >
  36. struct lambda_matches<
  37. T<BOOST_PP_ENUM_PARAMS(N, Expr)>
  38. , T<BOOST_PP_ENUM_PARAMS(N, Grammar)>
  39. BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)
  40. >
  41. : BOOST_PP_CAT(and_, N)<
  42. BOOST_PROTO_DEFINE_LAMBDA_MATCHES(~, 0, ~)::value,
  43. BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_LAMBDA_MATCHES, ~)
  44. >
  45. {};
  46. #undef N
  47. #endif