PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 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_CONSTRUCT_EVAL_HPP
 9#define PHOENIX_OBJECT_DETAIL_CONSTRUCT_EVAL_HPP
10
11#include <boost/preprocessor/iterate.hpp>
12#include <boost/preprocessor/cat.hpp>
13#include <boost/preprocessor/repetition/enum_params.hpp>
14#include <boost/preprocessor/repetition/enum_binary_params.hpp>
15
16#define PHOENIX_EVAL_ARG(z, n, data)                                            \
17    BOOST_PP_CAT(_, n).eval(env)
18
19#define BOOST_PP_ITERATION_PARAMS_1                                             \
20    (3, (3, PHOENIX_COMPOSITE_LIMIT,                                            \
21    "boost/spirit/home/phoenix/object/detail/construct_eval.hpp"))
22#include BOOST_PP_ITERATE()
23
24#undef PHOENIX_EVAL_ARG
25#endif
26
27///////////////////////////////////////////////////////////////////////////////
28//
29//  Preprocessor vertical repetition code
30//
31///////////////////////////////////////////////////////////////////////////////
32#else // defined(BOOST_PP_IS_ITERATING)
33
34#define N BOOST_PP_ITERATION()
35
36    template <typename RT, typename Env, BOOST_PP_ENUM_PARAMS(N, typename A)>
37    static RT
38    eval(Env const& env, BOOST_PP_ENUM_BINARY_PARAMS(N, A, & _))
39    {
40        return RT(BOOST_PP_ENUM(N, PHOENIX_EVAL_ARG, _));
41    }
42
43#undef N
44#endif // defined(BOOST_PP_IS_ITERATING)
45
46