new_eval.hpp 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  2. #ifndef BOOST_PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
  3. #define BOOST_PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
  4. #include <boost/phoenix/object/detail/cpp03/preprocessed/new_eval.hpp>
  5. #endif
  6. #else
  7. #if !BOOST_PHOENIX_IS_ITERATING
  8. #ifndef BOOST_PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
  9. #define BOOST_PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
  10. #include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp>
  11. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  12. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/new_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  13. #endif
  14. /*==============================================================================
  15. Copyright (c) 2005-2010 Joel de Guzman
  16. Copyright (c) 2010 Thomas Heller
  17. Distributed under the Boost Software License, Version 1.0. (See accompanying
  18. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  19. ==============================================================================*/
  20. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(preserve: 1)
  22. #endif
  23. #define BOOST_PHOENIX_ITERATION_PARAMS \
  24. (3, (2, BOOST_PHOENIX_COMPOSITE_LIMIT, \
  25. <boost/phoenix/object/detail/cpp03/new_eval.hpp>))
  26. #include BOOST_PHOENIX_ITERATE()
  27. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  28. #pragma wave option(output: null)
  29. #endif
  30. #endif
  31. #else
  32. template <typename This, BOOST_PHOENIX_typename_A, typename Context>
  33. struct result<This(BOOST_PHOENIX_A, Context)>
  34. {
  35. typedef
  36. typename proto::detail::uncvref<
  37. typename proto::result_of::value<A0>::type
  38. >::type
  39. target_type;
  40. typedef typename target_type::type construct_type;
  41. typedef typename target_type::type * type;
  42. };
  43. template <BOOST_PHOENIX_typename_A, typename Context>
  44. typename result<new_eval(BOOST_PHOENIX_A_const_ref, Context &)>::type
  45. operator()(
  46. A0 const&
  47. , BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(
  48. BOOST_PHOENIX_ITERATION
  49. , A
  50. , const& a
  51. )
  52. , Context const & ctx
  53. ) const
  54. {
  55. #define EVAL_a(_,n,__) \
  56. BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) boost::phoenix::eval(a ## n, ctx)
  57. return
  58. new typename result<
  59. new_eval(BOOST_PHOENIX_A_const_ref, Context &)
  60. >::construct_type(
  61. BOOST_PP_REPEAT_FROM_TO(
  62. 1
  63. , BOOST_PHOENIX_ITERATION
  64. , EVAL_a
  65. , _
  66. )
  67. );
  68. #undef EVAL_a
  69. }
  70. #endif
  71. #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES