/src/contrib/boost/spirit/home/phoenix/object/detail/construct_eval.hpp

http://pythonocc.googlecode.com/ · C++ Header · 46 lines · 25 code · 10 blank · 11 comment · 0 complexity · 78c8792c773a2b001f06dee9ec91dbf2 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_OBJECT_DETAIL_CONSTRUCT_EVAL_HPP
  8. #define PHOENIX_OBJECT_DETAIL_CONSTRUCT_EVAL_HPP
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/cat.hpp>
  11. #include <boost/preprocessor/repetition/enum_params.hpp>
  12. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  13. #define PHOENIX_EVAL_ARG(z, n, data) \
  14. BOOST_PP_CAT(_, n).eval(env)
  15. #define BOOST_PP_ITERATION_PARAMS_1 \
  16. (3, (3, PHOENIX_COMPOSITE_LIMIT, \
  17. "boost/spirit/home/phoenix/object/detail/construct_eval.hpp"))
  18. #include BOOST_PP_ITERATE()
  19. #undef PHOENIX_EVAL_ARG
  20. #endif
  21. ///////////////////////////////////////////////////////////////////////////////
  22. //
  23. // Preprocessor vertical repetition code
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. #else // defined(BOOST_PP_IS_ITERATING)
  27. #define N BOOST_PP_ITERATION()
  28. template <typename RT, typename Env, BOOST_PP_ENUM_PARAMS(N, typename A)>
  29. static RT
  30. eval(Env const& env, BOOST_PP_ENUM_BINARY_PARAMS(N, A, & _))
  31. {
  32. return RT(BOOST_PP_ENUM(N, PHOENIX_EVAL_ARG, _));
  33. }
  34. #undef N
  35. #endif // defined(BOOST_PP_IS_ITERATING)