PageRenderTime 15ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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