phx2_result.hpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*=============================================================================
  2. Copyright (c) 2011 Thomas Heller
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !BOOST_PHOENIX_IS_ITERATING
  7. template <typename F, BOOST_PHOENIX_typename_A_void(BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT)), typename Dummy = void>
  8. struct has_phx2_result
  9. : mpl::false_
  10. {};
  11. template <typename F, BOOST_PHOENIX_typename_A_void(BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT)), typename Dummy = void>
  12. struct phx2_result;
  13. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  14. #include <boost/phoenix/core/detail/cpp03/preprocessed/phx2_result.hpp>
  15. #else
  16. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  17. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/phx2_result_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  18. #endif
  19. /*=============================================================================
  20. Copyright (c) 2011 Thomas Heller
  21. Distributed under the Boost Software License, Version 1.0. (See accompanying
  22. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  23. ==============================================================================*/
  24. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  25. #pragma wave option(preserve: 1)
  26. #endif
  27. #define BOOST_PHOENIX_ITERATION_PARAMS \
  28. (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT), \
  29. <boost/phoenix/core/detail/cpp03/phx2_result.hpp>))
  30. #include BOOST_PHOENIX_ITERATE()
  31. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  32. #pragma wave option(output: null)
  33. #endif
  34. #endif
  35. #else
  36. template <typename F, BOOST_PHOENIX_typename_A>
  37. struct has_phx2_result<F, BOOST_PHOENIX_A>
  38. : mpl::eval_if<
  39. has_result_type<F>
  40. , mpl::false_
  41. , has_phx2_result_impl<typename F::template result<F(BOOST_PHOENIX_A)> >
  42. >::type
  43. {};
  44. template <typename F, BOOST_PHOENIX_typename_A>
  45. struct phx2_result<F, BOOST_PHOENIX_A>
  46. {
  47. typedef typename F::template result<BOOST_PHOENIX_A>::type type;
  48. };
  49. template <typename F, BOOST_PHOENIX_typename_A>
  50. struct phx2_result<F, BOOST_PHOENIX_A_ref>
  51. {
  52. typedef typename F::template result<BOOST_PHOENIX_A>::type type;
  53. };
  54. template <typename F, BOOST_PHOENIX_typename_A>
  55. struct phx2_result<F, BOOST_PHOENIX_A_const_ref>
  56. {
  57. typedef typename F::template result<BOOST_PHOENIX_A>::type type;
  58. };
  59. #endif