/Src/Dependencies/Boost/boost/proto/transform/detail/pass_through_impl.hpp

http://hadesmem.googlecode.com/ · C++ Header · 95 lines · 63 code · 18 blank · 14 comment · 3 complexity · 73ae56644c1d2dee846404de559a6e5d MD5 · raw file

  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/transform/detail/preprocessed/pass_through_impl.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA) \
  5. typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
  6. typename result_of::child_c<Expr, N>::type \
  7. , State \
  8. , Data \
  9. >::result_type \
  10. /**/
  11. #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA) \
  12. typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl< \
  13. typename result_of::child_c<Expr, N>::type \
  14. , State \
  15. , Data \
  16. >()( \
  17. e.proto_base().BOOST_PP_CAT(child, N), s, d \
  18. ) \
  19. /**/
  20. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/pass_through_impl.hpp")
  22. #endif
  23. ///////////////////////////////////////////////////////////////////////////////
  24. /// \file pass_through_impl.hpp
  25. ///
  26. /// Specializations of pass_through_impl, used in the implementation of the
  27. /// pass_through transform.
  28. //
  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)
  32. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  33. #pragma wave option(preserve: 1)
  34. #endif
  35. #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/pass_through_impl.hpp>))
  36. #include BOOST_PP_ITERATE()
  37. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  38. #pragma wave option(output: null)
  39. #endif
  40. #undef BOOST_PROTO_DEFINE_TRANSFORM
  41. #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
  42. #else
  43. #define N BOOST_PP_ITERATION()
  44. template<typename Grammar, typename Expr, typename State, typename Data>
  45. struct pass_through_impl<Grammar, Expr, State, Data, N>
  46. : transform_impl<Expr, State, Data>
  47. {
  48. typedef typename pass_through_impl::expr unref_expr;
  49. typedef
  50. typename base_expr<
  51. typename unref_expr::proto_domain
  52. , typename unref_expr::proto_tag
  53. , BOOST_PP_CAT(list, N)<
  54. BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
  55. >
  56. >::type
  57. expr_type;
  58. typedef typename unref_expr::proto_generator proto_generator;
  59. typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
  60. result_type const operator ()(
  61. typename pass_through_impl::expr_param e
  62. , typename pass_through_impl::state_param s
  63. , typename pass_through_impl::data_param d
  64. ) const
  65. {
  66. expr_type const that = {
  67. BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
  68. };
  69. // Without this, MSVC complains that "that" is uninitialized,
  70. // and it actually triggers a runtime check in debug mode when
  71. // built with VC8.
  72. detail::ignore_unused(&that);
  73. return proto_generator()(that);
  74. }
  75. };
  76. #undef N
  77. #endif