1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #ifndef BOOST_PP_IS_ITERATING
8 #ifndef PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
9 #define PHOENIX_OBJECT_DETAIL_NEW_EVAL_HPP
11 #include <boost/preprocessor/iterate.hpp>
12 #include <boost/preprocessor/cat.hpp>
13 #include <boost/preprocessor/repetition/enum.hpp>
14 #include <boost/preprocessor/repetition/enum_params.hpp>
15 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
17 #define PHOENIX_EVAL_ARG(z, n, data) \
18 BOOST_PP_CAT(_, n).eval(env)
20 #define BOOST_PP_ITERATION_PARAMS_1 \
21 (3, (3, PHOENIX_COMPOSITE_LIMIT, \
22 "boost/spirit/home/phoenix/object/detail/new_eval.hpp"))
23 #include BOOST_PP_ITERATE()
25 #undef PHOENIX_EVAL_ARG
28 ///////////////////////////////////////////////////////////////////////////////
30 // Preprocessor vertical repetition code
32 ///////////////////////////////////////////////////////////////////////////////
33 #else // defined(BOOST_PP_IS_ITERATING)
35 #define N BOOST_PP_ITERATION()
37 template <typename RT, typename Env, BOOST_PP_ENUM_PARAMS(N, typename A)>
39 eval(Env const& env, BOOST_PP_ENUM_BINARY_PARAMS(N, A, & _))
41 return new T(BOOST_PP_ENUM(N, PHOENIX_EVAL_ARG, _));
45 #endif // defined(BOOST_PP_IS_ITERATING)