/Src/Dependencies/Boost/boost/spirit/home/phoenix/core/detail/actor.hpp

http://hadesmem.googlecode.com/ · C++ Header · 65 lines · 43 code · 11 blank · 11 comment · 0 complexity · df7a302a6f76db654f115ab734ebeb30 MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2001-2007 Joel de Guzman
  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. #ifndef BOOST_PP_IS_ITERATING
  7. #ifndef PHOENIX_CORE_DETAIL_ACTOR_HPP
  8. #define PHOENIX_CORE_DETAIL_ACTOR_HPP
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/repetition/enum_params.hpp>
  11. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  12. #include <boost/preprocessor/facilities/intercept.hpp>
  13. #define BOOST_PP_ITERATION_PARAMS_1 \
  14. (3, (3, PHOENIX_ACTOR_LIMIT, \
  15. "boost/spirit/home/phoenix/core/detail/actor.hpp"))
  16. #include BOOST_PP_ITERATE()
  17. #endif
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Preprocessor vertical repetition code
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. #else // defined(BOOST_PP_IS_ITERATING)
  24. #define N BOOST_PP_ITERATION()
  25. template <BOOST_PP_ENUM_PARAMS(N, typename T)>
  26. actor(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _))
  27. : Eval(BOOST_PP_ENUM_PARAMS(N, _)) {}
  28. template <typename F, BOOST_PP_ENUM_PARAMS(N, typename A)>
  29. struct result<F(BOOST_PP_ENUM_PARAMS(N, A))>
  30. : eval_result<
  31. eval_type
  32. , basic_environment<
  33. BOOST_PP_ENUM_BINARY_PARAMS(
  34. N
  35. , typename remove_reference<A
  36. , >::type BOOST_PP_INTERCEPT
  37. )
  38. >
  39. >
  40. {};
  41. template <BOOST_PP_ENUM_PARAMS(N, typename T)>
  42. typename result<
  43. actor(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & BOOST_PP_INTERCEPT))
  44. >::type
  45. operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _)) const
  46. {
  47. return eval_type::eval(
  48. basic_environment<BOOST_PP_ENUM_PARAMS(N, T)>(
  49. BOOST_PP_ENUM_PARAMS(N, _))
  50. );
  51. }
  52. #undef N
  53. #endif // defined(BOOST_PP_IS_ITERATING)