2 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
3 #ifndef BOOST_PHOENIX_CORE_DETAIL_ACTOR_OPERATOR_HPP
4 #define BOOST_PHOENIX_CORE_DETAIL_ACTOR_OPERATOR_HPP
6 #include <boost/phoenix/support/iterate.hpp>
8 #include <boost/phoenix/core/detail/cpp03/preprocessed/actor_operator.hpp>
13 #if !BOOST_PHOENIX_IS_ITERATING
15 #ifndef BOOST_PHOENIX_CORE_DETAIL_ACTOR_OPERATOR_HPP
16 #define BOOST_PHOENIX_CORE_DETAIL_ACTOR_OPERATOR_HPP
18 #include <boost/phoenix/support/iterate.hpp>
20 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
21 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/actor_operator_" BOOST_PHOENIX_LIMIT_STR ".hpp")
23 /*==============================================================================
24 Copyright (c) 2005-2010 Joel de Guzman
25 Copyright (c) 2010 Thomas Heller
27 Distributed under the Boost Software License, Version 1.0. (See accompanying
28 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
29 ==============================================================================*/
31 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
32 #pragma wave option(preserve: 1)
36 typename detail::result_type_deduction_helper<BOOST_PP_CAT(A, N)>::type \
39 #define BOOST_PHOENIX_ITERATION_PARAMS \
40 (3, (1, BOOST_PHOENIX_ACTOR_LIMIT, \
41 <boost/phoenix/core/detail/cpp03/actor_operator.hpp>))
42 #include BOOST_PHOENIX_ITERATE()
46 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
47 #pragma wave option(output: null)
54 #if BOOST_PHOENIX_ITERATION >= BOOST_PHOENIX_PERFECT_FORWARD_LIMIT
56 template <typename This, BOOST_PHOENIX_typename_A>
57 struct result<This(BOOST_PHOENIX_A)>
58 : result<This(BOOST_PHOENIX_A_const_ref)>
61 template <typename This, BOOST_PHOENIX_typename_A>
62 struct result<This(BOOST_PHOENIX_A_ref)>
63 : result_of::actor<proto_base_expr, BOOST_PHOENIX_A_ref>
66 template <BOOST_PHOENIX_typename_A>
67 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_A_ref>::type
68 operator()(BOOST_PHOENIX_A_ref_a)
71 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))<
72 const actor<Expr> *, BOOST_PHOENIX_A_ref
75 env_type env = {this, BOOST_PHOENIX_a};
77 return phoenix::eval(*this, phoenix::context(env, default_actions()));
80 template <BOOST_PHOENIX_typename_A>
81 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_A_ref>::type
82 operator()(BOOST_PHOENIX_A_ref_a) const
85 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))<
86 const actor<Expr> *, BOOST_PHOENIX_A_ref
89 env_type env = {this, BOOST_PHOENIX_a};
91 return phoenix::eval(*this, phoenix::context(env, default_actions()));
94 template <BOOST_PHOENIX_typename_A>
95 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_A_const_ref>::type
96 operator()(BOOST_PHOENIX_A_const_ref_a)
99 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))<
100 const actor<Expr> *, BOOST_PHOENIX_A_const_ref
103 env_type env = {this, BOOST_PHOENIX_a};
105 return phoenix::eval(*this, phoenix::context(env, default_actions()));
108 template <BOOST_PHOENIX_typename_A>
109 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_A_const_ref>::type
110 operator()(BOOST_PHOENIX_A_const_ref_a) const
113 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))<
114 const actor<Expr> *, BOOST_PHOENIX_A_const_ref
117 env_type env = {this, BOOST_PHOENIX_a};
119 return phoenix::eval(*this, phoenix::context(env, default_actions()));
124 // We need to define operator() for all permutations of reference types.
125 // For BOOST_PHOENIX_ITERATION <= BOOST_PHOENIX_LIMIT_PREFECT_FORWARD
126 // 2^BOOST_PHOENIX_ITERATION overloads are created
127 // For compile time reasons,
128 // if BOOST_PHOENIX_ITERATION > BOOST_PHOENIX_LIMIT_PERFECT_FORWARD
129 // only operator()(A const &...a) and operator()(A &...a) are generated
130 // this is all handled by the PP mumbo jumbo above
131 #define BOOST_PHOENIX_ACTOR_OPERATOR(_, I, __) \
132 template <typename This, BOOST_PHOENIX_typename_A> \
133 struct result<This(BOOST_PHOENIX_PERM_A(I))> \
134 : result_of::actor<proto_base_expr, BOOST_PHOENIX_PERM_A(I)> \
137 template <BOOST_PHOENIX_typename_A> \
138 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_PERM_A(I)>::type\
139 operator()(BOOST_PHOENIX_PERM_A_a(I)) const \
142 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))< \
143 const actor<Expr> *, BOOST_PHOENIX_PERM_A(I) \
146 env_type env = {this, BOOST_PHOENIX_a}; \
148 return phoenix::eval(*this, phoenix::context(env, default_actions()));\
151 template <BOOST_PHOENIX_typename_A> \
152 typename result_of::actor<proto_base_expr, BOOST_PHOENIX_PERM_A(I)>::type\
153 operator()(BOOST_PHOENIX_PERM_A_a(I)) \
156 BOOST_PP_CAT(vector, BOOST_PP_INC(BOOST_PHOENIX_ITERATION))< \
157 const actor<Expr> *, BOOST_PHOENIX_PERM_A(I) \
160 env_type env = {this, BOOST_PHOENIX_a}; \
162 return phoenix::eval(*this, phoenix::context(env, default_actions()));\
166 template <typename This, BOOST_PHOENIX_typename_A>
167 struct result<This(BOOST_PHOENIX_A)>
168 : result<This(BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, M0, _))>
171 BOOST_PP_REPEAT(BOOST_PHOENIX_PERM_SIZE, BOOST_PHOENIX_ACTOR_OPERATOR, _)
173 #undef BOOST_PHOENIX_ACTOR_OPERATOR
179 #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES