deduce_domain_n.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/detail/preprocessed/deduce_domain_n.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #define BOOST_PROTO_COMMON_DOMAIN2(Z, N, DATA) \
  5. typedef \
  6. typename common_domain2<common ## N, A ## N>::type \
  7. BOOST_PP_CAT(common, BOOST_PP_INC(N)); \
  8. /**/
  9. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  10. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deduce_domain_n.hpp")
  11. #endif
  12. ///////////////////////////////////////////////////////////////////////////////
  13. // deduce_domain_n.hpp
  14. // Definitions of common_domain[n] and deduce_domain[n] class templates.
  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, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deduce_domain_n.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_COMMON_DOMAIN2
  29. #else
  30. #define N BOOST_PP_ITERATION()
  31. template<BOOST_PP_ENUM_PARAMS(N, typename A)>
  32. struct BOOST_PP_CAT(common_domain, N)
  33. {
  34. typedef A0 common1;
  35. BOOST_PP_REPEAT_FROM_TO(1, N, BOOST_PROTO_COMMON_DOMAIN2, ~)
  36. typedef BOOST_PP_CAT(common, N) type;
  37. BOOST_PROTO_ASSERT_VALID_DOMAIN(type);
  38. };
  39. template<BOOST_PP_ENUM_PARAMS(N, typename E)>
  40. struct BOOST_PP_CAT(deduce_domain, N)
  41. : BOOST_PP_CAT(common_domain, N)<
  42. BOOST_PP_ENUM_BINARY_PARAMS(
  43. N
  44. , typename domain_of<E, >::type BOOST_PP_INTERCEPT
  45. )
  46. >
  47. {};
  48. #undef N
  49. #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES