sl@0
|
1 |
/*=============================================================================
|
sl@0
|
2 |
Phoenix V1.2.1
|
sl@0
|
3 |
Copyright (c) 2001-2002 Joel de Guzman
|
sl@0
|
4 |
|
sl@0
|
5 |
Use, modification and distribution is subject to the Boost Software
|
sl@0
|
6 |
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
7 |
http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
8 |
==============================================================================*/
|
sl@0
|
9 |
#ifndef PHOENIX_FUNCTIONS_HPP
|
sl@0
|
10 |
#define PHOENIX_FUNCTIONS_HPP
|
sl@0
|
11 |
|
sl@0
|
12 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
13 |
#include <boost/spirit/phoenix/actor.hpp>
|
sl@0
|
14 |
#include <boost/spirit/phoenix/composite.hpp>
|
sl@0
|
15 |
|
sl@0
|
16 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
17 |
namespace phoenix {
|
sl@0
|
18 |
|
sl@0
|
19 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
20 |
//
|
sl@0
|
21 |
// function class
|
sl@0
|
22 |
//
|
sl@0
|
23 |
// Lazy functions
|
sl@0
|
24 |
//
|
sl@0
|
25 |
// This class provides a mechanism for lazily evaluating functions.
|
sl@0
|
26 |
// Syntactically, a lazy function looks like an ordinary C/C++
|
sl@0
|
27 |
// function. The function call looks the same. However, unlike
|
sl@0
|
28 |
// ordinary functions, the actual function execution is deferred.
|
sl@0
|
29 |
// (see actor.hpp, primitives.hpp and composite.hpp for an
|
sl@0
|
30 |
// overview). For example here are sample factorial function calls:
|
sl@0
|
31 |
//
|
sl@0
|
32 |
// factorial(4)
|
sl@0
|
33 |
// factorial(arg1)
|
sl@0
|
34 |
// factorial(arg1 * 6)
|
sl@0
|
35 |
//
|
sl@0
|
36 |
// These functions are automatically lazily bound unlike ordinary
|
sl@0
|
37 |
// function pointers or functor objects that need to be explicitly
|
sl@0
|
38 |
// bound through the bind function (see binders.hpp).
|
sl@0
|
39 |
//
|
sl@0
|
40 |
// A lazy function works in conjunction with a user defined functor
|
sl@0
|
41 |
// (as usual with a member operator()). Only special forms of
|
sl@0
|
42 |
// functor objects are allowed. This is required to enable true
|
sl@0
|
43 |
// polymorphism (STL style monomorphic functors and function
|
sl@0
|
44 |
// pointers can still be used through the bind facility in
|
sl@0
|
45 |
// binders.hpp).
|
sl@0
|
46 |
//
|
sl@0
|
47 |
// This special functor is expected to have a nested template class
|
sl@0
|
48 |
// result<A...TN> (where N is the number of arguments of its
|
sl@0
|
49 |
// member operator()). The nested template class result should have
|
sl@0
|
50 |
// a typedef 'type' that reflects the return type of its member
|
sl@0
|
51 |
// operator(). This is essentially a type computer that answers the
|
sl@0
|
52 |
// metaprogramming question "Given arguments of type A...TN, what
|
sl@0
|
53 |
// will be the operator()'s return type?".
|
sl@0
|
54 |
//
|
sl@0
|
55 |
// There is a special case for functors that accept no arguments.
|
sl@0
|
56 |
// Such nullary functors are only required to define a typedef
|
sl@0
|
57 |
// result_type that reflects the return type of its operator().
|
sl@0
|
58 |
//
|
sl@0
|
59 |
// Here's an example of a simple functor that computes the
|
sl@0
|
60 |
// factorial of a number:
|
sl@0
|
61 |
//
|
sl@0
|
62 |
// struct factorial_impl {
|
sl@0
|
63 |
//
|
sl@0
|
64 |
// template <typename Arg>
|
sl@0
|
65 |
// struct result { typedef Arg type; };
|
sl@0
|
66 |
//
|
sl@0
|
67 |
// template <typename Arg>
|
sl@0
|
68 |
// Arg operator()(Arg n) const
|
sl@0
|
69 |
// { return (n <= 0) ? 1 : n * this->operator()(n-1); }
|
sl@0
|
70 |
// };
|
sl@0
|
71 |
//
|
sl@0
|
72 |
// As can be seen, the functor can be polymorphic. Its arguments
|
sl@0
|
73 |
// and return type are not fixed to a particular type. The example
|
sl@0
|
74 |
// above for example, can handle any type as long as it can carry
|
sl@0
|
75 |
// out the required operations (i.e. <=, * and -).
|
sl@0
|
76 |
//
|
sl@0
|
77 |
// We can now declare and instantiate a lazy 'factorial' function:
|
sl@0
|
78 |
//
|
sl@0
|
79 |
// function<factorial_impl> factorial;
|
sl@0
|
80 |
//
|
sl@0
|
81 |
// Invoking a lazy function 'factorial' does not immediately
|
sl@0
|
82 |
// execute the functor factorial_impl. Instead, a composite (see
|
sl@0
|
83 |
// composite.hpp) object is created and returned to the caller.
|
sl@0
|
84 |
// Example:
|
sl@0
|
85 |
//
|
sl@0
|
86 |
// factorial(arg1)
|
sl@0
|
87 |
//
|
sl@0
|
88 |
// does nothing more than return a composite. A second function
|
sl@0
|
89 |
// call will invoke the actual factorial function. Example:
|
sl@0
|
90 |
//
|
sl@0
|
91 |
// int i = 4;
|
sl@0
|
92 |
// cout << factorial(arg1)(i);
|
sl@0
|
93 |
//
|
sl@0
|
94 |
// will print out "24".
|
sl@0
|
95 |
//
|
sl@0
|
96 |
// Take note that in certain cases (e.g. for functors with state),
|
sl@0
|
97 |
// an instance may be passed on to the constructor. Example:
|
sl@0
|
98 |
//
|
sl@0
|
99 |
// function<factorial_impl> factorial(ftor);
|
sl@0
|
100 |
//
|
sl@0
|
101 |
// where ftor is an instance of factorial_impl (this is not
|
sl@0
|
102 |
// necessary in this case since factorial is a simple stateless
|
sl@0
|
103 |
// functor). Take care though when using functors with state
|
sl@0
|
104 |
// because the functors are taken in by value. It is best to keep
|
sl@0
|
105 |
// the data manipulated by a functor outside the functor itself and
|
sl@0
|
106 |
// keep a reference to this data inside the functor. Also, it is
|
sl@0
|
107 |
// best to keep functors as small as possible.
|
sl@0
|
108 |
//
|
sl@0
|
109 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
110 |
template <typename OperationT>
|
sl@0
|
111 |
struct function {
|
sl@0
|
112 |
|
sl@0
|
113 |
function() : op() {}
|
sl@0
|
114 |
function(OperationT const& op_) : op(op_) {}
|
sl@0
|
115 |
|
sl@0
|
116 |
actor<composite<OperationT> >
|
sl@0
|
117 |
operator()() const;
|
sl@0
|
118 |
|
sl@0
|
119 |
template <typename A>
|
sl@0
|
120 |
typename impl::make_composite<OperationT, A>::type
|
sl@0
|
121 |
operator()(A const& a) const;
|
sl@0
|
122 |
|
sl@0
|
123 |
template <typename A, typename B>
|
sl@0
|
124 |
typename impl::make_composite<OperationT, A, B>::type
|
sl@0
|
125 |
operator()(A const& a, B const& b) const;
|
sl@0
|
126 |
|
sl@0
|
127 |
template <typename A, typename B, typename C>
|
sl@0
|
128 |
typename impl::make_composite<OperationT, A, B, C>::type
|
sl@0
|
129 |
operator()(A const& a, B const& b, C const& c) const;
|
sl@0
|
130 |
|
sl@0
|
131 |
#if PHOENIX_LIMIT > 3
|
sl@0
|
132 |
|
sl@0
|
133 |
template <typename A, typename B, typename C, typename D>
|
sl@0
|
134 |
typename impl::make_composite<OperationT, A, B, C, D>::type
|
sl@0
|
135 |
operator()(A const& a, B const& b, C const& c, D const& d) const;
|
sl@0
|
136 |
|
sl@0
|
137 |
template <typename A, typename B, typename C, typename D, typename E>
|
sl@0
|
138 |
typename impl::make_composite<
|
sl@0
|
139 |
OperationT, A, B, C, D, E
|
sl@0
|
140 |
>::type
|
sl@0
|
141 |
operator()(
|
sl@0
|
142 |
A const& a, B const& b, C const& c, D const& d, E const& e
|
sl@0
|
143 |
) const;
|
sl@0
|
144 |
|
sl@0
|
145 |
template <
|
sl@0
|
146 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
147 |
typename F
|
sl@0
|
148 |
>
|
sl@0
|
149 |
typename impl::make_composite<
|
sl@0
|
150 |
OperationT, A, B, C, D, E, F
|
sl@0
|
151 |
>::type
|
sl@0
|
152 |
operator()(
|
sl@0
|
153 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
154 |
F const& f
|
sl@0
|
155 |
) const;
|
sl@0
|
156 |
|
sl@0
|
157 |
#if PHOENIX_LIMIT > 6
|
sl@0
|
158 |
|
sl@0
|
159 |
template <
|
sl@0
|
160 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
161 |
typename F, typename G
|
sl@0
|
162 |
>
|
sl@0
|
163 |
typename impl::make_composite<
|
sl@0
|
164 |
OperationT, A, B, C, D, E, F, G
|
sl@0
|
165 |
>::type
|
sl@0
|
166 |
operator()(
|
sl@0
|
167 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
168 |
F const& f, G const& g
|
sl@0
|
169 |
) const;
|
sl@0
|
170 |
|
sl@0
|
171 |
template <
|
sl@0
|
172 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
173 |
typename F, typename G, typename H
|
sl@0
|
174 |
>
|
sl@0
|
175 |
typename impl::make_composite<
|
sl@0
|
176 |
OperationT, A, B, C, D, E, F, G, H
|
sl@0
|
177 |
>::type
|
sl@0
|
178 |
operator()(
|
sl@0
|
179 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
180 |
F const& f, G const& g, H const& h
|
sl@0
|
181 |
) const;
|
sl@0
|
182 |
|
sl@0
|
183 |
template <
|
sl@0
|
184 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
185 |
typename F, typename G, typename H, typename I
|
sl@0
|
186 |
>
|
sl@0
|
187 |
typename impl::make_composite<
|
sl@0
|
188 |
OperationT, A, B, C, D, E, F, G, H, I
|
sl@0
|
189 |
>::type
|
sl@0
|
190 |
operator()(
|
sl@0
|
191 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
192 |
F const& f, G const& g, H const& h, I const& i
|
sl@0
|
193 |
) const;
|
sl@0
|
194 |
|
sl@0
|
195 |
#if PHOENIX_LIMIT > 9
|
sl@0
|
196 |
|
sl@0
|
197 |
template <
|
sl@0
|
198 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
199 |
typename F, typename G, typename H, typename I, typename J
|
sl@0
|
200 |
>
|
sl@0
|
201 |
typename impl::make_composite<
|
sl@0
|
202 |
OperationT, A, B, C, D, E, F, G, H, I, J
|
sl@0
|
203 |
>::type
|
sl@0
|
204 |
operator()(
|
sl@0
|
205 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
206 |
F const& f, G const& g, H const& h, I const& i, J const& j
|
sl@0
|
207 |
) const;
|
sl@0
|
208 |
|
sl@0
|
209 |
template <
|
sl@0
|
210 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
211 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
212 |
typename K
|
sl@0
|
213 |
>
|
sl@0
|
214 |
typename impl::make_composite<
|
sl@0
|
215 |
OperationT, A, B, C, D, E, F, G, H, I, J, K
|
sl@0
|
216 |
>::type
|
sl@0
|
217 |
operator()(
|
sl@0
|
218 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
219 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
220 |
K const& k
|
sl@0
|
221 |
) const;
|
sl@0
|
222 |
|
sl@0
|
223 |
template <
|
sl@0
|
224 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
225 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
226 |
typename K, typename L
|
sl@0
|
227 |
>
|
sl@0
|
228 |
typename impl::make_composite<
|
sl@0
|
229 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L
|
sl@0
|
230 |
>::type
|
sl@0
|
231 |
operator()(
|
sl@0
|
232 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
233 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
234 |
K const& k, L const& l
|
sl@0
|
235 |
) const;
|
sl@0
|
236 |
|
sl@0
|
237 |
#if PHOENIX_LIMIT > 12
|
sl@0
|
238 |
|
sl@0
|
239 |
template <
|
sl@0
|
240 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
241 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
242 |
typename K, typename L, typename M
|
sl@0
|
243 |
>
|
sl@0
|
244 |
typename impl::make_composite<
|
sl@0
|
245 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M
|
sl@0
|
246 |
>::type
|
sl@0
|
247 |
operator()(
|
sl@0
|
248 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
249 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
250 |
K const& k, L const& l, M const& m
|
sl@0
|
251 |
) const;
|
sl@0
|
252 |
|
sl@0
|
253 |
template <
|
sl@0
|
254 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
255 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
256 |
typename K, typename L, typename M, typename N
|
sl@0
|
257 |
>
|
sl@0
|
258 |
typename impl::make_composite<
|
sl@0
|
259 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N
|
sl@0
|
260 |
>::type
|
sl@0
|
261 |
operator()(
|
sl@0
|
262 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
263 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
264 |
K const& k, L const& l, M const& m, N const& n
|
sl@0
|
265 |
) const;
|
sl@0
|
266 |
|
sl@0
|
267 |
template <
|
sl@0
|
268 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
269 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
270 |
typename K, typename L, typename M, typename N, typename O
|
sl@0
|
271 |
>
|
sl@0
|
272 |
typename impl::make_composite<
|
sl@0
|
273 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O
|
sl@0
|
274 |
>::type
|
sl@0
|
275 |
operator()(
|
sl@0
|
276 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
277 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
278 |
K const& k, L const& l, M const& m, N const& n, O const& o
|
sl@0
|
279 |
) const;
|
sl@0
|
280 |
|
sl@0
|
281 |
#endif
|
sl@0
|
282 |
#endif
|
sl@0
|
283 |
#endif
|
sl@0
|
284 |
#endif
|
sl@0
|
285 |
|
sl@0
|
286 |
OperationT op;
|
sl@0
|
287 |
};
|
sl@0
|
288 |
|
sl@0
|
289 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
290 |
//
|
sl@0
|
291 |
// function class implementation
|
sl@0
|
292 |
//
|
sl@0
|
293 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
294 |
template <typename OperationT>
|
sl@0
|
295 |
inline actor<composite<OperationT> >
|
sl@0
|
296 |
function<OperationT>::operator()() const
|
sl@0
|
297 |
{
|
sl@0
|
298 |
return actor<composite<OperationT> >(op);
|
sl@0
|
299 |
}
|
sl@0
|
300 |
|
sl@0
|
301 |
//////////////////////////////////
|
sl@0
|
302 |
template <typename OperationT>
|
sl@0
|
303 |
template <typename A>
|
sl@0
|
304 |
inline typename impl::make_composite<OperationT, A>::type
|
sl@0
|
305 |
function<OperationT>::operator()(A const& a) const
|
sl@0
|
306 |
{
|
sl@0
|
307 |
typedef typename impl::make_composite<OperationT, A>::composite_type ret_t;
|
sl@0
|
308 |
return ret_t
|
sl@0
|
309 |
(
|
sl@0
|
310 |
op,
|
sl@0
|
311 |
as_actor<A>::convert(a)
|
sl@0
|
312 |
);
|
sl@0
|
313 |
}
|
sl@0
|
314 |
|
sl@0
|
315 |
//////////////////////////////////
|
sl@0
|
316 |
template <typename OperationT>
|
sl@0
|
317 |
template <typename A, typename B>
|
sl@0
|
318 |
inline typename impl::make_composite<OperationT, A, B>::type
|
sl@0
|
319 |
function<OperationT>::operator()(A const& a, B const& b) const
|
sl@0
|
320 |
{
|
sl@0
|
321 |
typedef
|
sl@0
|
322 |
typename impl::make_composite<OperationT, A, B>::composite_type
|
sl@0
|
323 |
ret_t;
|
sl@0
|
324 |
|
sl@0
|
325 |
return ret_t(
|
sl@0
|
326 |
op,
|
sl@0
|
327 |
as_actor<A>::convert(a),
|
sl@0
|
328 |
as_actor<B>::convert(b)
|
sl@0
|
329 |
);
|
sl@0
|
330 |
}
|
sl@0
|
331 |
|
sl@0
|
332 |
//////////////////////////////////
|
sl@0
|
333 |
template <typename OperationT>
|
sl@0
|
334 |
template <typename A, typename B, typename C>
|
sl@0
|
335 |
inline typename impl::make_composite<OperationT, A, B, C>::type
|
sl@0
|
336 |
function<OperationT>::operator()(A const& a, B const& b, C const& c) const
|
sl@0
|
337 |
{
|
sl@0
|
338 |
typedef
|
sl@0
|
339 |
typename impl::make_composite<OperationT, A, B, C>::composite_type
|
sl@0
|
340 |
ret_t;
|
sl@0
|
341 |
|
sl@0
|
342 |
return ret_t(
|
sl@0
|
343 |
op,
|
sl@0
|
344 |
as_actor<A>::convert(a),
|
sl@0
|
345 |
as_actor<B>::convert(b),
|
sl@0
|
346 |
as_actor<C>::convert(c)
|
sl@0
|
347 |
);
|
sl@0
|
348 |
}
|
sl@0
|
349 |
|
sl@0
|
350 |
#if PHOENIX_LIMIT > 3
|
sl@0
|
351 |
//////////////////////////////////
|
sl@0
|
352 |
template <typename OperationT>
|
sl@0
|
353 |
template <
|
sl@0
|
354 |
typename A, typename B, typename C, typename D
|
sl@0
|
355 |
>
|
sl@0
|
356 |
inline typename impl::make_composite<
|
sl@0
|
357 |
OperationT, A, B, C, D
|
sl@0
|
358 |
>::type
|
sl@0
|
359 |
function<OperationT>::operator()(
|
sl@0
|
360 |
A const& a, B const& b, C const& c, D const& d
|
sl@0
|
361 |
) const
|
sl@0
|
362 |
{
|
sl@0
|
363 |
typedef typename impl::make_composite<
|
sl@0
|
364 |
OperationT, A, B, C, D
|
sl@0
|
365 |
>::composite_type ret_t;
|
sl@0
|
366 |
|
sl@0
|
367 |
return ret_t(
|
sl@0
|
368 |
op,
|
sl@0
|
369 |
as_actor<A>::convert(a),
|
sl@0
|
370 |
as_actor<B>::convert(b),
|
sl@0
|
371 |
as_actor<C>::convert(c),
|
sl@0
|
372 |
as_actor<D>::convert(d)
|
sl@0
|
373 |
);
|
sl@0
|
374 |
}
|
sl@0
|
375 |
|
sl@0
|
376 |
//////////////////////////////////
|
sl@0
|
377 |
template <typename OperationT>
|
sl@0
|
378 |
template <
|
sl@0
|
379 |
typename A, typename B, typename C, typename D, typename E
|
sl@0
|
380 |
>
|
sl@0
|
381 |
inline typename impl::make_composite<
|
sl@0
|
382 |
OperationT, A, B, C, D, E
|
sl@0
|
383 |
>::type
|
sl@0
|
384 |
function<OperationT>::operator()(
|
sl@0
|
385 |
A const& a, B const& b, C const& c, D const& d, E const& e
|
sl@0
|
386 |
) const
|
sl@0
|
387 |
{
|
sl@0
|
388 |
typedef typename impl::make_composite<
|
sl@0
|
389 |
OperationT, A, B, C, D, E
|
sl@0
|
390 |
>::composite_type ret_t;
|
sl@0
|
391 |
|
sl@0
|
392 |
return ret_t(
|
sl@0
|
393 |
op,
|
sl@0
|
394 |
as_actor<A>::convert(a),
|
sl@0
|
395 |
as_actor<B>::convert(b),
|
sl@0
|
396 |
as_actor<C>::convert(c),
|
sl@0
|
397 |
as_actor<D>::convert(d),
|
sl@0
|
398 |
as_actor<E>::convert(e)
|
sl@0
|
399 |
);
|
sl@0
|
400 |
}
|
sl@0
|
401 |
|
sl@0
|
402 |
//////////////////////////////////
|
sl@0
|
403 |
template <typename OperationT>
|
sl@0
|
404 |
template <
|
sl@0
|
405 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
406 |
typename F
|
sl@0
|
407 |
>
|
sl@0
|
408 |
inline typename impl::make_composite<
|
sl@0
|
409 |
OperationT, A, B, C, D, E, F
|
sl@0
|
410 |
>::type
|
sl@0
|
411 |
function<OperationT>::operator()(
|
sl@0
|
412 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
413 |
F const& f
|
sl@0
|
414 |
) const
|
sl@0
|
415 |
{
|
sl@0
|
416 |
typedef typename impl::make_composite<
|
sl@0
|
417 |
OperationT, A, B, C, D, E, F
|
sl@0
|
418 |
>::composite_type ret_t;
|
sl@0
|
419 |
|
sl@0
|
420 |
return ret_t(
|
sl@0
|
421 |
op,
|
sl@0
|
422 |
as_actor<A>::convert(a),
|
sl@0
|
423 |
as_actor<B>::convert(b),
|
sl@0
|
424 |
as_actor<C>::convert(c),
|
sl@0
|
425 |
as_actor<D>::convert(d),
|
sl@0
|
426 |
as_actor<E>::convert(e),
|
sl@0
|
427 |
as_actor<F>::convert(f)
|
sl@0
|
428 |
);
|
sl@0
|
429 |
}
|
sl@0
|
430 |
|
sl@0
|
431 |
#if PHOENIX_LIMIT > 6
|
sl@0
|
432 |
|
sl@0
|
433 |
//////////////////////////////////
|
sl@0
|
434 |
template <typename OperationT>
|
sl@0
|
435 |
template <
|
sl@0
|
436 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
437 |
typename F, typename G
|
sl@0
|
438 |
>
|
sl@0
|
439 |
inline typename impl::make_composite<
|
sl@0
|
440 |
OperationT, A, B, C, D, E, F, G
|
sl@0
|
441 |
>::type
|
sl@0
|
442 |
function<OperationT>::operator()(
|
sl@0
|
443 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
444 |
F const& f, G const& g
|
sl@0
|
445 |
) const
|
sl@0
|
446 |
{
|
sl@0
|
447 |
typedef typename impl::make_composite<
|
sl@0
|
448 |
OperationT, A, B, C, D, E, F, G
|
sl@0
|
449 |
>::composite_type ret_t;
|
sl@0
|
450 |
|
sl@0
|
451 |
return ret_t(
|
sl@0
|
452 |
op,
|
sl@0
|
453 |
as_actor<A>::convert(a),
|
sl@0
|
454 |
as_actor<B>::convert(b),
|
sl@0
|
455 |
as_actor<C>::convert(c),
|
sl@0
|
456 |
as_actor<D>::convert(d),
|
sl@0
|
457 |
as_actor<E>::convert(e),
|
sl@0
|
458 |
as_actor<F>::convert(f),
|
sl@0
|
459 |
as_actor<G>::convert(g)
|
sl@0
|
460 |
);
|
sl@0
|
461 |
}
|
sl@0
|
462 |
|
sl@0
|
463 |
//////////////////////////////////
|
sl@0
|
464 |
template <typename OperationT>
|
sl@0
|
465 |
template <
|
sl@0
|
466 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
467 |
typename F, typename G, typename H
|
sl@0
|
468 |
>
|
sl@0
|
469 |
inline typename impl::make_composite<
|
sl@0
|
470 |
OperationT, A, B, C, D, E, F, G, H
|
sl@0
|
471 |
>::type
|
sl@0
|
472 |
function<OperationT>::operator()(
|
sl@0
|
473 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
474 |
F const& f, G const& g, H const& h
|
sl@0
|
475 |
) const
|
sl@0
|
476 |
{
|
sl@0
|
477 |
typedef typename impl::make_composite<
|
sl@0
|
478 |
OperationT, A, B, C, D, E, F, G, H
|
sl@0
|
479 |
>::composite_type ret_t;
|
sl@0
|
480 |
|
sl@0
|
481 |
return ret_t(
|
sl@0
|
482 |
op,
|
sl@0
|
483 |
as_actor<A>::convert(a),
|
sl@0
|
484 |
as_actor<B>::convert(b),
|
sl@0
|
485 |
as_actor<C>::convert(c),
|
sl@0
|
486 |
as_actor<D>::convert(d),
|
sl@0
|
487 |
as_actor<E>::convert(e),
|
sl@0
|
488 |
as_actor<F>::convert(f),
|
sl@0
|
489 |
as_actor<G>::convert(g),
|
sl@0
|
490 |
as_actor<H>::convert(h)
|
sl@0
|
491 |
);
|
sl@0
|
492 |
}
|
sl@0
|
493 |
|
sl@0
|
494 |
//////////////////////////////////
|
sl@0
|
495 |
template <typename OperationT>
|
sl@0
|
496 |
template <
|
sl@0
|
497 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
498 |
typename F, typename G, typename H, typename I
|
sl@0
|
499 |
>
|
sl@0
|
500 |
inline typename impl::make_composite<
|
sl@0
|
501 |
OperationT, A, B, C, D, E, F, G, H, I
|
sl@0
|
502 |
>::type
|
sl@0
|
503 |
function<OperationT>::operator()(
|
sl@0
|
504 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
505 |
F const& f, G const& g, H const& h, I const& i
|
sl@0
|
506 |
) const
|
sl@0
|
507 |
{
|
sl@0
|
508 |
typedef typename impl::make_composite<
|
sl@0
|
509 |
OperationT, A, B, C, D, E, F, G, H, I
|
sl@0
|
510 |
>::composite_type ret_t;
|
sl@0
|
511 |
|
sl@0
|
512 |
return ret_t(
|
sl@0
|
513 |
op,
|
sl@0
|
514 |
as_actor<A>::convert(a),
|
sl@0
|
515 |
as_actor<B>::convert(b),
|
sl@0
|
516 |
as_actor<C>::convert(c),
|
sl@0
|
517 |
as_actor<D>::convert(d),
|
sl@0
|
518 |
as_actor<E>::convert(e),
|
sl@0
|
519 |
as_actor<F>::convert(f),
|
sl@0
|
520 |
as_actor<G>::convert(g),
|
sl@0
|
521 |
as_actor<H>::convert(h),
|
sl@0
|
522 |
as_actor<I>::convert(i)
|
sl@0
|
523 |
);
|
sl@0
|
524 |
}
|
sl@0
|
525 |
|
sl@0
|
526 |
#if PHOENIX_LIMIT > 9
|
sl@0
|
527 |
|
sl@0
|
528 |
//////////////////////////////////
|
sl@0
|
529 |
template <typename OperationT>
|
sl@0
|
530 |
template <
|
sl@0
|
531 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
532 |
typename F, typename G, typename H, typename I, typename J
|
sl@0
|
533 |
>
|
sl@0
|
534 |
inline typename impl::make_composite<
|
sl@0
|
535 |
OperationT, A, B, C, D, E, F, G, H, I, J
|
sl@0
|
536 |
>::type
|
sl@0
|
537 |
function<OperationT>::operator()(
|
sl@0
|
538 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
539 |
F const& f, G const& g, H const& h, I const& i, J const& j
|
sl@0
|
540 |
) const
|
sl@0
|
541 |
{
|
sl@0
|
542 |
typedef typename impl::make_composite<
|
sl@0
|
543 |
OperationT, A, B, C, D, E, F, G, H, I, J
|
sl@0
|
544 |
>::composite_type ret_t;
|
sl@0
|
545 |
|
sl@0
|
546 |
return ret_t(
|
sl@0
|
547 |
op,
|
sl@0
|
548 |
as_actor<A>::convert(a),
|
sl@0
|
549 |
as_actor<B>::convert(b),
|
sl@0
|
550 |
as_actor<C>::convert(c),
|
sl@0
|
551 |
as_actor<D>::convert(d),
|
sl@0
|
552 |
as_actor<E>::convert(e),
|
sl@0
|
553 |
as_actor<F>::convert(f),
|
sl@0
|
554 |
as_actor<G>::convert(g),
|
sl@0
|
555 |
as_actor<H>::convert(h),
|
sl@0
|
556 |
as_actor<I>::convert(i),
|
sl@0
|
557 |
as_actor<J>::convert(j)
|
sl@0
|
558 |
);
|
sl@0
|
559 |
}
|
sl@0
|
560 |
|
sl@0
|
561 |
//////////////////////////////////
|
sl@0
|
562 |
template <typename OperationT>
|
sl@0
|
563 |
template <
|
sl@0
|
564 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
565 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
566 |
typename K
|
sl@0
|
567 |
>
|
sl@0
|
568 |
inline typename impl::make_composite<
|
sl@0
|
569 |
OperationT, A, B, C, D, E, F, G, H, I, J, K
|
sl@0
|
570 |
>::type
|
sl@0
|
571 |
function<OperationT>::operator()(
|
sl@0
|
572 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
573 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
574 |
K const& k
|
sl@0
|
575 |
) const
|
sl@0
|
576 |
{
|
sl@0
|
577 |
typedef typename impl::make_composite<
|
sl@0
|
578 |
OperationT, A, B, C, D, E, F, G, H, I, J, K
|
sl@0
|
579 |
>::composite_type ret_t;
|
sl@0
|
580 |
|
sl@0
|
581 |
return ret_t(
|
sl@0
|
582 |
op,
|
sl@0
|
583 |
as_actor<A>::convert(a),
|
sl@0
|
584 |
as_actor<B>::convert(b),
|
sl@0
|
585 |
as_actor<C>::convert(c),
|
sl@0
|
586 |
as_actor<D>::convert(d),
|
sl@0
|
587 |
as_actor<E>::convert(e),
|
sl@0
|
588 |
as_actor<F>::convert(f),
|
sl@0
|
589 |
as_actor<G>::convert(g),
|
sl@0
|
590 |
as_actor<H>::convert(h),
|
sl@0
|
591 |
as_actor<I>::convert(i),
|
sl@0
|
592 |
as_actor<J>::convert(j),
|
sl@0
|
593 |
as_actor<K>::convert(k)
|
sl@0
|
594 |
);
|
sl@0
|
595 |
}
|
sl@0
|
596 |
|
sl@0
|
597 |
//////////////////////////////////
|
sl@0
|
598 |
template <typename OperationT>
|
sl@0
|
599 |
template <
|
sl@0
|
600 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
601 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
602 |
typename K, typename L
|
sl@0
|
603 |
>
|
sl@0
|
604 |
inline typename impl::make_composite<
|
sl@0
|
605 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L
|
sl@0
|
606 |
>::type
|
sl@0
|
607 |
function<OperationT>::operator()(
|
sl@0
|
608 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
609 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
610 |
K const& k, L const& l
|
sl@0
|
611 |
) const
|
sl@0
|
612 |
{
|
sl@0
|
613 |
typedef typename impl::make_composite<
|
sl@0
|
614 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L
|
sl@0
|
615 |
>::composite_type ret_t;
|
sl@0
|
616 |
|
sl@0
|
617 |
return ret_t(
|
sl@0
|
618 |
op,
|
sl@0
|
619 |
as_actor<A>::convert(a),
|
sl@0
|
620 |
as_actor<B>::convert(b),
|
sl@0
|
621 |
as_actor<C>::convert(c),
|
sl@0
|
622 |
as_actor<D>::convert(d),
|
sl@0
|
623 |
as_actor<E>::convert(e),
|
sl@0
|
624 |
as_actor<F>::convert(f),
|
sl@0
|
625 |
as_actor<G>::convert(g),
|
sl@0
|
626 |
as_actor<H>::convert(h),
|
sl@0
|
627 |
as_actor<I>::convert(i),
|
sl@0
|
628 |
as_actor<J>::convert(j),
|
sl@0
|
629 |
as_actor<K>::convert(k),
|
sl@0
|
630 |
as_actor<L>::convert(l)
|
sl@0
|
631 |
);
|
sl@0
|
632 |
}
|
sl@0
|
633 |
|
sl@0
|
634 |
#if PHOENIX_LIMIT > 12
|
sl@0
|
635 |
|
sl@0
|
636 |
//////////////////////////////////
|
sl@0
|
637 |
template <typename OperationT>
|
sl@0
|
638 |
template <
|
sl@0
|
639 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
640 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
641 |
typename K, typename L, typename M
|
sl@0
|
642 |
>
|
sl@0
|
643 |
inline typename impl::make_composite<
|
sl@0
|
644 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M
|
sl@0
|
645 |
>::type
|
sl@0
|
646 |
function<OperationT>::operator()(
|
sl@0
|
647 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
648 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
649 |
K const& k, L const& l, M const& m
|
sl@0
|
650 |
) const
|
sl@0
|
651 |
{
|
sl@0
|
652 |
typedef typename impl::make_composite<
|
sl@0
|
653 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M
|
sl@0
|
654 |
>::composite_type ret_t;
|
sl@0
|
655 |
|
sl@0
|
656 |
return ret_t(
|
sl@0
|
657 |
op,
|
sl@0
|
658 |
as_actor<A>::convert(a),
|
sl@0
|
659 |
as_actor<B>::convert(b),
|
sl@0
|
660 |
as_actor<C>::convert(c),
|
sl@0
|
661 |
as_actor<D>::convert(d),
|
sl@0
|
662 |
as_actor<E>::convert(e),
|
sl@0
|
663 |
as_actor<F>::convert(f),
|
sl@0
|
664 |
as_actor<G>::convert(g),
|
sl@0
|
665 |
as_actor<H>::convert(h),
|
sl@0
|
666 |
as_actor<I>::convert(i),
|
sl@0
|
667 |
as_actor<J>::convert(j),
|
sl@0
|
668 |
as_actor<K>::convert(k),
|
sl@0
|
669 |
as_actor<L>::convert(l),
|
sl@0
|
670 |
as_actor<M>::convert(m)
|
sl@0
|
671 |
);
|
sl@0
|
672 |
}
|
sl@0
|
673 |
|
sl@0
|
674 |
//////////////////////////////////
|
sl@0
|
675 |
template <typename OperationT>
|
sl@0
|
676 |
template <
|
sl@0
|
677 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
678 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
679 |
typename K, typename L, typename M, typename N
|
sl@0
|
680 |
>
|
sl@0
|
681 |
inline typename impl::make_composite<
|
sl@0
|
682 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N
|
sl@0
|
683 |
>::type
|
sl@0
|
684 |
function<OperationT>::operator()(
|
sl@0
|
685 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
686 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
687 |
K const& k, L const& l, M const& m, N const& n
|
sl@0
|
688 |
) const
|
sl@0
|
689 |
{
|
sl@0
|
690 |
typedef typename impl::make_composite<
|
sl@0
|
691 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N
|
sl@0
|
692 |
>::composite_type ret_t;
|
sl@0
|
693 |
|
sl@0
|
694 |
return ret_t(
|
sl@0
|
695 |
op,
|
sl@0
|
696 |
as_actor<A>::convert(a),
|
sl@0
|
697 |
as_actor<B>::convert(b),
|
sl@0
|
698 |
as_actor<C>::convert(c),
|
sl@0
|
699 |
as_actor<D>::convert(d),
|
sl@0
|
700 |
as_actor<E>::convert(e),
|
sl@0
|
701 |
as_actor<F>::convert(f),
|
sl@0
|
702 |
as_actor<G>::convert(g),
|
sl@0
|
703 |
as_actor<H>::convert(h),
|
sl@0
|
704 |
as_actor<I>::convert(i),
|
sl@0
|
705 |
as_actor<J>::convert(j),
|
sl@0
|
706 |
as_actor<K>::convert(k),
|
sl@0
|
707 |
as_actor<L>::convert(l),
|
sl@0
|
708 |
as_actor<M>::convert(m),
|
sl@0
|
709 |
as_actor<N>::convert(n)
|
sl@0
|
710 |
);
|
sl@0
|
711 |
}
|
sl@0
|
712 |
|
sl@0
|
713 |
//////////////////////////////////
|
sl@0
|
714 |
template <typename OperationT>
|
sl@0
|
715 |
template <
|
sl@0
|
716 |
typename A, typename B, typename C, typename D, typename E,
|
sl@0
|
717 |
typename F, typename G, typename H, typename I, typename J,
|
sl@0
|
718 |
typename K, typename L, typename M, typename N, typename O
|
sl@0
|
719 |
>
|
sl@0
|
720 |
inline typename impl::make_composite<
|
sl@0
|
721 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O
|
sl@0
|
722 |
>::type
|
sl@0
|
723 |
function<OperationT>::operator()(
|
sl@0
|
724 |
A const& a, B const& b, C const& c, D const& d, E const& e,
|
sl@0
|
725 |
F const& f, G const& g, H const& h, I const& i, J const& j,
|
sl@0
|
726 |
K const& k, L const& l, M const& m, N const& n, O const& o
|
sl@0
|
727 |
) const
|
sl@0
|
728 |
{
|
sl@0
|
729 |
typedef typename impl::make_composite<
|
sl@0
|
730 |
OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O
|
sl@0
|
731 |
>::composite_type ret_t;
|
sl@0
|
732 |
|
sl@0
|
733 |
return ret_t(
|
sl@0
|
734 |
op,
|
sl@0
|
735 |
as_actor<A>::convert(a),
|
sl@0
|
736 |
as_actor<B>::convert(b),
|
sl@0
|
737 |
as_actor<C>::convert(c),
|
sl@0
|
738 |
as_actor<D>::convert(d),
|
sl@0
|
739 |
as_actor<E>::convert(e),
|
sl@0
|
740 |
as_actor<F>::convert(f),
|
sl@0
|
741 |
as_actor<G>::convert(g),
|
sl@0
|
742 |
as_actor<H>::convert(h),
|
sl@0
|
743 |
as_actor<I>::convert(i),
|
sl@0
|
744 |
as_actor<J>::convert(j),
|
sl@0
|
745 |
as_actor<K>::convert(k),
|
sl@0
|
746 |
as_actor<L>::convert(l),
|
sl@0
|
747 |
as_actor<M>::convert(m),
|
sl@0
|
748 |
as_actor<N>::convert(n),
|
sl@0
|
749 |
as_actor<O>::convert(o)
|
sl@0
|
750 |
);
|
sl@0
|
751 |
}
|
sl@0
|
752 |
|
sl@0
|
753 |
#endif
|
sl@0
|
754 |
#endif
|
sl@0
|
755 |
#endif
|
sl@0
|
756 |
#endif
|
sl@0
|
757 |
|
sl@0
|
758 |
///////////////////////////////////////////////////////////////////////////////
|
sl@0
|
759 |
} // namespace phoenix
|
sl@0
|
760 |
|
sl@0
|
761 |
#endif
|