vararg_matches_impl.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/detail/preprocessed/vararg_matches_impl.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  5. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/vararg_matches_impl.hpp")
  6. #endif
  7. ///////////////////////////////////////////////////////////////////////////////
  8. /// \file vararg_matches_impl.hpp
  9. /// Specializations of the vararg_matches_impl template
  10. //
  11. // Copyright 2008 Eric Niebler. Distributed under the Boost
  12. // Software License, Version 1.0. (See accompanying file
  13. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  14. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  15. #pragma wave option(preserve: 1)
  16. #endif
  17. #define BOOST_PP_ITERATION_PARAMS_1 \
  18. (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/vararg_matches_impl.hpp>))
  19. #include BOOST_PP_ITERATE()
  20. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(output: null)
  22. #endif
  23. #else // BOOST_PP_IS_ITERATING
  24. #define N BOOST_PP_ITERATION()
  25. template<typename Args, typename Back, long To>
  26. struct vararg_matches_impl<Args, Back, N, To>
  27. : and_2<
  28. matches_<
  29. typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
  30. , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
  31. , Back
  32. >::value
  33. , vararg_matches_impl<Args, Back, N + 1, To>
  34. >
  35. {};
  36. template<typename Args, typename Back>
  37. struct vararg_matches_impl<Args, Back, N, N>
  38. : matches_<
  39. typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_derived_expr
  40. , typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
  41. , Back
  42. >
  43. {};
  44. #undef N
  45. #endif