terminal_expression.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2001-2011 Hartmut Kaiser
  4. Copyright (c) 2011 Thomas Heller
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #if !defined(BOOST_SPIRIT_TERMINAL_EXPRESSION_MARCH_24_2011_1210AM)
  9. #define BOOST_SPIRIT_TERMINAL_EXPRESSION_MARCH_24_2011_1210AM
  10. #ifndef BOOST_SPIRIT_USE_PHOENIX_V3
  11. namespace boost { namespace phoenix { namespace detail
  12. {
  13. namespace expression
  14. {
  15. template <
  16. typename F, typename A0 = void, typename A1 = void
  17. , typename A2 = void, typename Dummy = void>
  18. struct function_eval;
  19. template <typename F, typename A0>
  20. struct function_eval<F, A0>
  21. {
  22. typedef phoenix::actor<
  23. typename phoenix::as_composite<
  24. phoenix::detail::function_eval<1>, F, A0
  25. >::type
  26. > type;
  27. static type make(F f, A0 const & _0)
  28. {
  29. return phoenix::compose<
  30. phoenix::detail::function_eval<1> >(f, _0);
  31. }
  32. };
  33. template <typename F, typename A0, typename A1>
  34. struct function_eval<F, A0, A1>
  35. {
  36. typedef phoenix::actor<
  37. typename phoenix::as_composite<
  38. phoenix::detail::function_eval<2>, F, A0, A1
  39. >::type
  40. > type;
  41. static type make(F f, A0 const & _0, A1 const & _1)
  42. {
  43. return phoenix::compose<
  44. phoenix::detail::function_eval<2> >(f, _0, _1);
  45. }
  46. };
  47. template <typename F, typename A0, typename A1, typename A2>
  48. struct function_eval<F, A0, A1, A2>
  49. {
  50. typedef phoenix::actor<
  51. typename phoenix::as_composite<
  52. phoenix::detail::function_eval<3>, F, A0, A1, A2
  53. >::type
  54. > type;
  55. static type make(F f, A0 const & _0, A1 const & _1, A2 const & _2)
  56. {
  57. return phoenix::compose<
  58. phoenix::detail::function_eval<3> >(f, _0, _1, _2);
  59. }
  60. };
  61. }
  62. }}}
  63. #endif // !BOOST_SPIRIT_USE_PHOENIX_V3
  64. #endif