PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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