/Src/Dependencies/Boost/boost/spirit/home/phoenix/scope/detail/local_gen.hpp

http://hadesmem.googlecode.com/ · C++ Header · 57 lines · 34 code · 11 blank · 12 comment · 0 complexity · 1e604dcfa0953fadf4d8d264709a79ff 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. // Allow multiple inclusion. let.hpp and lambda.hpp will have the guards
  8. #include <boost/preprocessor/iterate.hpp>
  9. #include <boost/preprocessor/repetition/enum.hpp>
  10. #include <boost/preprocessor/repetition/enum_params.hpp>
  11. #define PHOENIX_LOCAL_GEN_PARAM(z, n, data) \
  12. actor<composite<assign_eval \
  13. , fusion::vector<local_variable<K##n>, V##n> > > const& a##n
  14. #define PHOENIX_LOCAL_GEN_ACTOR(z, n, data) \
  15. fusion::at_c<1>(a##n)
  16. #define BOOST_PP_ITERATION_PARAMS_1 \
  17. (3, (3, PHOENIX_LOCAL_LIMIT, \
  18. "boost/spirit/home/phoenix/scope/detail/local_gen.hpp"))
  19. #include BOOST_PP_ITERATE()
  20. #undef PHOENIX_LOCAL_GEN_PARAM
  21. #undef PHOENIX_LOCAL_GEN_ACTOR
  22. ///////////////////////////////////////////////////////////////////////////////
  23. //
  24. // Preprocessor vertical repetition code
  25. //
  26. ///////////////////////////////////////////////////////////////////////////////
  27. #else // defined(BOOST_PP_IS_ITERATING)
  28. #define N BOOST_PP_ITERATION()
  29. template <
  30. BOOST_PP_ENUM_PARAMS(N, typename K)
  31. , BOOST_PP_ENUM_PARAMS(N, typename V)
  32. >
  33. PHOENIX_LOCAL_GEN_NAME<
  34. fusion::vector<BOOST_PP_ENUM_PARAMS(N, V)>
  35. , detail::map_local_index_to_tuple<BOOST_PP_ENUM_PARAMS(N, K)>
  36. >
  37. operator()(
  38. BOOST_PP_ENUM(N, PHOENIX_LOCAL_GEN_PARAM, _)
  39. ) const
  40. {
  41. return fusion::vector<BOOST_PP_ENUM_PARAMS(N, V)>(
  42. BOOST_PP_ENUM(N, PHOENIX_LOCAL_GEN_ACTOR, _));
  43. }
  44. #undef N
  45. #endif // defined(BOOST_PP_IS_ITERATING)