mem_fun_ptr_eval.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #if !BOOST_PHOENIX_IS_ITERATING
  2. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  3. #include <boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval.hpp>
  4. #else
  5. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  6. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/mem_fun_ptr_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  7. #endif
  8. /*==============================================================================
  9. Copyright (c) 2005-2010 Joel de Guzman
  10. Copyright (c) 2010 Thomas Heller
  11. Copyright (c) 2016 Kohei Takahashi
  12. Distributed under the Boost Software License, Version 1.0. (See accompanying
  13. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  14. ==============================================================================*/
  15. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  16. #pragma wave option(preserve: 1)
  17. #endif
  18. #define BOOST_PHOENIX_MEMBER_EVAL(Z, N, D) \
  19. BOOST_PP_COMMA_IF(BOOST_PP_NOT(BOOST_PP_EQUAL(N, 2))) \
  20. boost::phoenix::eval(BOOST_PP_CAT(a, N), ctx) \
  21. /**/
  22. #define BOOST_PHOENIX_ITERATION_PARAMS \
  23. (3, (2, BOOST_PHOENIX_LIMIT, \
  24. <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval.hpp>)) \
  25. /**/
  26. #include BOOST_PHOENIX_ITERATE()
  27. #undef BOOST_PHOENIX_MEMBER_EVAL
  28. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  29. #pragma wave option(output: null)
  30. #endif
  31. #endif
  32. #else // BOOST_PHOENIX_IS_ITERATING
  33. template <typename This, BOOST_PHOENIX_typename_A, typename Context>
  34. struct result<This(BOOST_PHOENIX_A, Context)>
  35. : result<This(BOOST_PHOENIX_A_const_ref, Context)>
  36. {};
  37. template <typename This, BOOST_PHOENIX_typename_A, typename Context>
  38. struct result<This(BOOST_PHOENIX_A_ref, Context)>
  39. : result_of::mem_fun_ptr_eval<Context, BOOST_PHOENIX_A>
  40. {};
  41. template <BOOST_PHOENIX_typename_A, typename Context>
  42. typename result_of::mem_fun_ptr_eval<Context, BOOST_PHOENIX_A>::type
  43. operator()(
  44. BOOST_PHOENIX_A_const_ref_a
  45. , Context const & ctx
  46. ) const
  47. {
  48. return
  49. (
  50. get_pointer(boost::phoenix::eval(a0, ctx))
  51. ->*boost::phoenix::eval(a1, ctx)
  52. )(
  53. BOOST_PP_REPEAT_FROM_TO(
  54. 2
  55. , BOOST_PHOENIX_ITERATION
  56. , BOOST_PHOENIX_MEMBER_EVAL
  57. , BOOST_PHOENIX_ITERATION
  58. )
  59. );
  60. }
  61. #endif