1 | /*============================================================================= |
---|
2 | Phoenix v1.2 |
---|
3 | Copyright (c) 2001-2002 Joel de Guzman |
---|
4 | |
---|
5 | Use, modification and distribution is subject to the Boost Software |
---|
6 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
7 | http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | ==============================================================================*/ |
---|
9 | #ifndef PHOENIX_BINDERS_HPP |
---|
10 | #define PHOENIX_BINDERS_HPP |
---|
11 | |
---|
12 | /////////////////////////////////////////////////////////////////////////////// |
---|
13 | #include <boost/spirit/phoenix/functions.hpp> |
---|
14 | #include <boost/type_traits/is_const.hpp> |
---|
15 | #include <boost/mpl/if.hpp> |
---|
16 | |
---|
17 | /////////////////////////////////////////////////////////////////////////////// |
---|
18 | namespace phoenix { |
---|
19 | |
---|
20 | /////////////////////////////////////////////////////////////////////////////// |
---|
21 | // |
---|
22 | // Binders |
---|
23 | // |
---|
24 | // There are times when it is desireable to bind a simple functor, |
---|
25 | // function, member function or member variable for deferred |
---|
26 | // evaluation. This can be done through the binding facilities |
---|
27 | // provided below. There are template classes: |
---|
28 | // |
---|
29 | // 1) function_ptr ( function pointer binder ) |
---|
30 | // 2) functor ( functor pointer binder ) |
---|
31 | // 3) member_function_ptr ( member function pointer binder ) |
---|
32 | // 4) member_var_ptr ( member variable pointer binder ) |
---|
33 | // |
---|
34 | // These template classes are specialized lazy function classes for |
---|
35 | // functors, function pointers, member function pointers and member |
---|
36 | // variable pointers, respectively. These are subclasses of the |
---|
37 | // lazy-function class (see functions.hpp). Each of these has a |
---|
38 | // corresponding overloaded bind(x) function. Each bind(x) function |
---|
39 | // generates a suitable binder object. |
---|
40 | // |
---|
41 | // Example, given a function foo: |
---|
42 | // |
---|
43 | // void foo_(int n) { std::cout << n << std::endl; } |
---|
44 | // |
---|
45 | // Here's how the function foo is bound: |
---|
46 | // |
---|
47 | // bind(&foo_) |
---|
48 | // |
---|
49 | // This bind expression results to a lazy-function (see |
---|
50 | // functions.hpp) that is lazily evaluated. This bind expression is |
---|
51 | // also equivalent to: |
---|
52 | // |
---|
53 | // function_ptr<void, int> foo = &foo_; |
---|
54 | // |
---|
55 | // The template parameter of the function_ptr is the return and |
---|
56 | // argument types of actual signature of the function to be bound |
---|
57 | // read from left to right: |
---|
58 | // |
---|
59 | // void foo_(int); ---> function_ptr<void, int> |
---|
60 | // |
---|
61 | // Either bind(&foo_) and its equivalent foo can now be used in the |
---|
62 | // same way a lazy function (see functions.hpp) is used: |
---|
63 | // |
---|
64 | // bind(&foo_)(arg1) |
---|
65 | // |
---|
66 | // or |
---|
67 | // |
---|
68 | // foo(arg1) |
---|
69 | // |
---|
70 | // The latter, of course, being much easier to understand. This is |
---|
71 | // now a full-fledged lazy function that can finally be evaluated |
---|
72 | // by another function call invocation. A second function call will |
---|
73 | // invoke the actual foo function: |
---|
74 | // |
---|
75 | // int i = 4; |
---|
76 | // foo(arg1)(i); |
---|
77 | // |
---|
78 | // will print out "4". |
---|
79 | // |
---|
80 | // Binding functors and member functions can be done similarly. |
---|
81 | // Here's how to bind a functor (e.g. std::plus<int>): |
---|
82 | // |
---|
83 | // bind(std::plus<int>()) |
---|
84 | // |
---|
85 | // or |
---|
86 | // |
---|
87 | // functor<std::plus<int> > plus; |
---|
88 | // |
---|
89 | // Again, these are full-fledged lazy functions. In this case, |
---|
90 | // unlike the first example, expect 2 arguments (std::plus<int> |
---|
91 | // needs two arguments lhs and rhs). Either or both of which can be |
---|
92 | // lazily bound: |
---|
93 | // |
---|
94 | // plus(arg1, arg2) // arg1 + arg2 |
---|
95 | // plus(100, arg1) // 100 + arg1 |
---|
96 | // plus(100, 200) // 300 |
---|
97 | // |
---|
98 | // A bound member function takes in a pointer or reference to an |
---|
99 | // object as the first argument. For instance, given: |
---|
100 | // |
---|
101 | // struct xyz { void foo(int) const; }; |
---|
102 | // |
---|
103 | // xyz's foo member function can be bound as: |
---|
104 | // |
---|
105 | // bind(&xyz::foo) |
---|
106 | // |
---|
107 | // or |
---|
108 | // |
---|
109 | // member_function_ptr<void, xyz, int> xyz_foo = &xyz::foo; |
---|
110 | // |
---|
111 | // The template parameter of the member_function_ptr is the return, |
---|
112 | // class and argument types of actual signature of the function to |
---|
113 | // be bound read from left to right: |
---|
114 | // |
---|
115 | // void xyz::foo_(int); ---> member_function_ptr<void, xyz, int> |
---|
116 | // |
---|
117 | // Take note that a member_function_ptr lazy-function expects the |
---|
118 | // first argument to be a pointer or reference to an object. Both |
---|
119 | // the object (reference or pointer) and the arguments can be |
---|
120 | // lazily bound. Examples: |
---|
121 | // |
---|
122 | // xyz obj; |
---|
123 | // xyz_foo(arg1, arg2) // arg1.foo(arg2) |
---|
124 | // xyz_foo(obj, arg1) // obj.foo(arg1) |
---|
125 | // xyz_foo(obj, 100) // obj.foo(100) |
---|
126 | // |
---|
127 | // Be reminded that var(obj) must be used to call non-const member |
---|
128 | // functions. For example, if xyz was declared as: |
---|
129 | // |
---|
130 | // struct xyz { void foo(int); }; |
---|
131 | // |
---|
132 | // the pointer or reference to the object must also be non-const. |
---|
133 | // Lazily bound arguments are stored as const value by default (see |
---|
134 | // variable class in primitives.hpp). |
---|
135 | // |
---|
136 | // xyz_foo(var(obj), 100) // obj.foo(100) |
---|
137 | // |
---|
138 | // Finally, member variables can be bound much like member |
---|
139 | // functions. For instance, given: |
---|
140 | // |
---|
141 | // struct xyz { int v; }; |
---|
142 | // |
---|
143 | // xyz::v can be bound as: |
---|
144 | // |
---|
145 | // bind(&xyz::v) |
---|
146 | // or |
---|
147 | // |
---|
148 | // member_var_ptr<int, xyz> xyz_v = &xyz::v; |
---|
149 | // |
---|
150 | // The template parameter of the member_var_ptr is the type of the |
---|
151 | // variable followed by the class: |
---|
152 | // |
---|
153 | // int xyz::v; ---> member_var_ptr<int, xyz> |
---|
154 | // |
---|
155 | // Just like the member_function_ptr, member_var_ptr also expects |
---|
156 | // the first argument to be a pointer or reference to an object. |
---|
157 | // Both the object (reference or pointer) and the arguments can be |
---|
158 | // lazily bound. Examples: |
---|
159 | // |
---|
160 | // xyz obj; |
---|
161 | // xyz_v(arg1) // arg1.v |
---|
162 | // xyz_v(obj) // obj.v |
---|
163 | // |
---|
164 | /////////////////////////////////////////////////////////////////////////////// |
---|
165 | |
---|
166 | /////////////////////////////////////////////////////////////////////////////// |
---|
167 | // |
---|
168 | // Functor binder |
---|
169 | // |
---|
170 | /////////////////////////////////////////////////////////////////////////////// |
---|
171 | template <typename FuncT> |
---|
172 | struct functor_action : public FuncT { |
---|
173 | |
---|
174 | #if !defined(__BORLANDC__) && (!defined(__MWERKS__) || (__MWERKS__ > 0x3002)) |
---|
175 | |
---|
176 | template < |
---|
177 | typename A = nil_t |
---|
178 | , typename B = nil_t |
---|
179 | , typename C = nil_t |
---|
180 | |
---|
181 | #if PHOENIX_LIMIT > 3 |
---|
182 | , typename D = nil_t |
---|
183 | , typename E = nil_t |
---|
184 | , typename F = nil_t |
---|
185 | |
---|
186 | #if PHOENIX_LIMIT > 6 |
---|
187 | , typename G = nil_t |
---|
188 | , typename H = nil_t |
---|
189 | , typename I = nil_t |
---|
190 | |
---|
191 | #if PHOENIX_LIMIT > 9 |
---|
192 | , typename J = nil_t |
---|
193 | , typename K = nil_t |
---|
194 | , typename L = nil_t |
---|
195 | |
---|
196 | #if PHOENIX_LIMIT > 12 |
---|
197 | , typename M = nil_t |
---|
198 | , typename N = nil_t |
---|
199 | , typename O = nil_t |
---|
200 | |
---|
201 | #endif |
---|
202 | #endif |
---|
203 | #endif |
---|
204 | #endif |
---|
205 | > |
---|
206 | struct result { typedef typename FuncT::result_type type; }; |
---|
207 | #endif |
---|
208 | |
---|
209 | functor_action(FuncT fptr_ = FuncT()) |
---|
210 | : FuncT(fptr_) {} |
---|
211 | }; |
---|
212 | |
---|
213 | #if defined(__BORLANDC__) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002)) |
---|
214 | |
---|
215 | /////////////////////////////////////////////////////////////////////////////// |
---|
216 | // |
---|
217 | // The following specializations are needed because Borland and CodeWarrior |
---|
218 | // does not accept default template arguments in nested template classes in |
---|
219 | // classes (i.e functor_action::result) |
---|
220 | // |
---|
221 | /////////////////////////////////////////////////////////////////////////////// |
---|
222 | template <typename FuncT, typename TupleT> |
---|
223 | struct composite0_result<functor_action<FuncT>, TupleT> { |
---|
224 | |
---|
225 | typedef typename FuncT::result_type type; |
---|
226 | }; |
---|
227 | |
---|
228 | ////////////////////////////////// |
---|
229 | template <typename FuncT, typename TupleT, |
---|
230 | typename A> |
---|
231 | struct composite1_result<functor_action<FuncT>, TupleT, A> { |
---|
232 | |
---|
233 | typedef typename FuncT::result_type type; |
---|
234 | }; |
---|
235 | |
---|
236 | ////////////////////////////////// |
---|
237 | template <typename FuncT, typename TupleT, |
---|
238 | typename A, typename B> |
---|
239 | struct composite2_result<functor_action<FuncT>, TupleT, A, B> { |
---|
240 | |
---|
241 | typedef typename FuncT::result_type type; |
---|
242 | }; |
---|
243 | |
---|
244 | ////////////////////////////////// |
---|
245 | template <typename FuncT, typename TupleT, |
---|
246 | typename A, typename B, typename C> |
---|
247 | struct composite3_result<functor_action<FuncT>, TupleT, A, B, C> { |
---|
248 | |
---|
249 | typedef typename FuncT::result_type type; |
---|
250 | }; |
---|
251 | |
---|
252 | #if PHOENIX_LIMIT > 3 |
---|
253 | ////////////////////////////////// |
---|
254 | template <typename FuncT, typename TupleT, |
---|
255 | typename A, typename B, typename C, typename D> |
---|
256 | struct composite4_result<functor_action<FuncT>, TupleT, |
---|
257 | A, B, C, D> { |
---|
258 | |
---|
259 | typedef typename FuncT::result_type type; |
---|
260 | }; |
---|
261 | |
---|
262 | ////////////////////////////////// |
---|
263 | template <typename FuncT, typename TupleT, |
---|
264 | typename A, typename B, typename C, typename D, typename E> |
---|
265 | struct composite5_result<functor_action<FuncT>, TupleT, |
---|
266 | A, B, C, D, E> { |
---|
267 | |
---|
268 | typedef typename FuncT::result_type type; |
---|
269 | }; |
---|
270 | |
---|
271 | ////////////////////////////////// |
---|
272 | template <typename FuncT, typename TupleT, |
---|
273 | typename A, typename B, typename C, typename D, typename E, |
---|
274 | typename F> |
---|
275 | struct composite6_result<functor_action<FuncT>, TupleT, |
---|
276 | A, B, C, D, E, F> { |
---|
277 | |
---|
278 | typedef typename FuncT::result_type type; |
---|
279 | }; |
---|
280 | |
---|
281 | #if PHOENIX_LIMIT > 6 |
---|
282 | ////////////////////////////////// |
---|
283 | template <typename FuncT, typename TupleT, |
---|
284 | typename A, typename B, typename C, typename D, typename E, |
---|
285 | typename F, typename G> |
---|
286 | struct composite7_result<functor_action<FuncT>, TupleT, |
---|
287 | A, B, C, D, E, F, G> { |
---|
288 | |
---|
289 | typedef typename FuncT::result_type type; |
---|
290 | }; |
---|
291 | |
---|
292 | ////////////////////////////////// |
---|
293 | template <typename FuncT, typename TupleT, |
---|
294 | typename A, typename B, typename C, typename D, typename E, |
---|
295 | typename F, typename G, typename H> |
---|
296 | struct composite8_result<functor_action<FuncT>, TupleT, |
---|
297 | A, B, C, D, E, F, G, H> { |
---|
298 | |
---|
299 | typedef typename FuncT::result_type type; |
---|
300 | }; |
---|
301 | |
---|
302 | ////////////////////////////////// |
---|
303 | template <typename FuncT, typename TupleT, |
---|
304 | typename A, typename B, typename C, typename D, typename E, |
---|
305 | typename F, typename G, typename H, typename I> |
---|
306 | struct composite9_result<functor_action<FuncT>, TupleT, |
---|
307 | A, B, C, D, E, F, G, H, I> { |
---|
308 | |
---|
309 | typedef typename FuncT::result_type type; |
---|
310 | }; |
---|
311 | |
---|
312 | #if PHOENIX_LIMIT > 9 |
---|
313 | ////////////////////////////////// |
---|
314 | template <typename FuncT, typename TupleT, |
---|
315 | typename A, typename B, typename C, typename D, typename E, |
---|
316 | typename F, typename G, typename H, typename I, typename J> |
---|
317 | struct composite10_result<functor_action<FuncT>, TupleT, |
---|
318 | A, B, C, D, E, F, G, H, I, J> { |
---|
319 | |
---|
320 | typedef typename FuncT::result_type type; |
---|
321 | }; |
---|
322 | |
---|
323 | ////////////////////////////////// |
---|
324 | template <typename FuncT, typename TupleT, |
---|
325 | typename A, typename B, typename C, typename D, typename E, |
---|
326 | typename F, typename G, typename H, typename I, typename J, |
---|
327 | typename K> |
---|
328 | struct composite11_result<functor_action<FuncT>, TupleT, |
---|
329 | A, B, C, D, E, F, G, H, I, J, K> { |
---|
330 | |
---|
331 | typedef typename FuncT::result_type type; |
---|
332 | }; |
---|
333 | |
---|
334 | ////////////////////////////////// |
---|
335 | template <typename FuncT, typename TupleT, |
---|
336 | typename A, typename B, typename C, typename D, typename E, |
---|
337 | typename F, typename G, typename H, typename I, typename J, |
---|
338 | typename K, typename L> |
---|
339 | struct composite12_result<functor_action<FuncT>, TupleT, |
---|
340 | A, B, C, D, E, F, G, H, I, J, K, L> { |
---|
341 | |
---|
342 | typedef typename FuncT::result_type type; |
---|
343 | }; |
---|
344 | |
---|
345 | #if PHOENIX_LIMIT > 12 |
---|
346 | ////////////////////////////////// |
---|
347 | template <typename FuncT, typename TupleT, |
---|
348 | typename A, typename B, typename C, typename D, typename E, |
---|
349 | typename F, typename G, typename H, typename I, typename J, |
---|
350 | typename K, typename L, typename M> |
---|
351 | struct composite13_result<functor_action<FuncT>, TupleT, |
---|
352 | A, B, C, D, E, F, G, H, I, J, K, L, M> { |
---|
353 | |
---|
354 | typedef typename FuncT::result_type type; |
---|
355 | }; |
---|
356 | |
---|
357 | ////////////////////////////////// |
---|
358 | template <typename FuncT, typename TupleT, |
---|
359 | typename A, typename B, typename C, typename D, typename E, |
---|
360 | typename F, typename G, typename H, typename I, typename J, |
---|
361 | typename K, typename L, typename M, typename N> |
---|
362 | struct composite14_result<functor_action<FuncT>, TupleT, |
---|
363 | A, B, C, D, E, F, G, H, I, J, K, L, M, N> { |
---|
364 | |
---|
365 | typedef typename FuncT::result_type type; |
---|
366 | }; |
---|
367 | |
---|
368 | ////////////////////////////////// |
---|
369 | template <typename FuncT, typename TupleT, |
---|
370 | typename A, typename B, typename C, typename D, typename E, |
---|
371 | typename F, typename G, typename H, typename I, typename J, |
---|
372 | typename K, typename L, typename M, typename N, typename O> |
---|
373 | struct composite15_result<functor_action<FuncT>, TupleT, |
---|
374 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> { |
---|
375 | |
---|
376 | typedef typename FuncT::result_type type; |
---|
377 | }; |
---|
378 | |
---|
379 | #endif |
---|
380 | #endif |
---|
381 | #endif |
---|
382 | #endif |
---|
383 | #endif |
---|
384 | |
---|
385 | ////////////////////////////////// |
---|
386 | template <typename FuncT> |
---|
387 | struct functor : public function<functor_action<FuncT> > { |
---|
388 | |
---|
389 | functor(FuncT func) |
---|
390 | : function<functor_action<FuncT> >(functor_action<FuncT>(func)) {}; |
---|
391 | }; |
---|
392 | |
---|
393 | ////////////////////////////////// |
---|
394 | template <typename FuncT> |
---|
395 | inline functor<FuncT> |
---|
396 | bind(FuncT func) |
---|
397 | { |
---|
398 | return functor<FuncT>(func); |
---|
399 | } |
---|
400 | |
---|
401 | /////////////////////////////////////////////////////////////////////////////// |
---|
402 | // |
---|
403 | // Member variable pointer binder |
---|
404 | // |
---|
405 | /////////////////////////////////////////////////////////////////////////////// |
---|
406 | namespace impl { |
---|
407 | |
---|
408 | ////////////////////////////////// |
---|
409 | template <typename T> |
---|
410 | struct as_ptr { |
---|
411 | |
---|
412 | typedef T* pointer_type; |
---|
413 | |
---|
414 | static T* get(T& ref) |
---|
415 | { return &ref; } |
---|
416 | }; |
---|
417 | |
---|
418 | ////////////////////////////////// |
---|
419 | template <typename T> |
---|
420 | struct as_ptr<T*> { |
---|
421 | |
---|
422 | typedef T* pointer_type; |
---|
423 | |
---|
424 | static T* get(T* ptr) |
---|
425 | { return ptr; } |
---|
426 | }; |
---|
427 | } |
---|
428 | |
---|
429 | ////////////////////////////////// |
---|
430 | template <typename ActionT, typename ClassT> |
---|
431 | struct member_var_ptr_action_result { |
---|
432 | |
---|
433 | typedef typename ActionT::template result<ClassT>::type type; |
---|
434 | }; |
---|
435 | |
---|
436 | ////////////////////////////////// |
---|
437 | template <typename T, typename ClassT> |
---|
438 | struct member_var_ptr_action { |
---|
439 | |
---|
440 | typedef member_var_ptr_action<T, ClassT> self_t; |
---|
441 | |
---|
442 | template <typename CT> |
---|
443 | struct result { |
---|
444 | typedef typename boost::mpl::if_<boost::is_const<CT>, T const&, T& |
---|
445 | >::type type; |
---|
446 | }; |
---|
447 | |
---|
448 | typedef T ClassT::*mem_var_ptr_t; |
---|
449 | |
---|
450 | member_var_ptr_action(mem_var_ptr_t ptr_) |
---|
451 | : ptr(ptr_) {} |
---|
452 | |
---|
453 | template <typename CT> |
---|
454 | typename member_var_ptr_action_result<self_t, CT>::type |
---|
455 | operator()(CT& obj) const |
---|
456 | { return impl::as_ptr<CT>::get(obj)->*ptr; } |
---|
457 | |
---|
458 | mem_var_ptr_t ptr; |
---|
459 | }; |
---|
460 | |
---|
461 | ////////////////////////////////// |
---|
462 | template <typename T, typename ClassT> |
---|
463 | struct member_var_ptr |
---|
464 | : public function<member_var_ptr_action<T, ClassT> > { |
---|
465 | |
---|
466 | member_var_ptr(T ClassT::*mp) |
---|
467 | : function<member_var_ptr_action<T, ClassT> > |
---|
468 | (member_var_ptr_action<T, ClassT>(mp)) {} |
---|
469 | }; |
---|
470 | |
---|
471 | ////////////////////////////////// |
---|
472 | template <typename T, typename ClassT> |
---|
473 | inline member_var_ptr<T, ClassT> |
---|
474 | bind(T ClassT::*mp) |
---|
475 | { |
---|
476 | return member_var_ptr<T, ClassT>(mp); |
---|
477 | } |
---|
478 | |
---|
479 | /////////////////////////////////////////////////////////////////////////////// |
---|
480 | // |
---|
481 | // Function pointer binder (main class) |
---|
482 | // |
---|
483 | /////////////////////////////////////////////////////////////////////////////// |
---|
484 | template < |
---|
485 | typename RT |
---|
486 | , typename A = nil_t |
---|
487 | , typename B = nil_t |
---|
488 | , typename C = nil_t |
---|
489 | |
---|
490 | #if PHOENIX_LIMIT > 3 |
---|
491 | , typename D = nil_t |
---|
492 | , typename E = nil_t |
---|
493 | , typename F = nil_t |
---|
494 | |
---|
495 | #if PHOENIX_LIMIT > 6 |
---|
496 | , typename G = nil_t |
---|
497 | , typename H = nil_t |
---|
498 | , typename I = nil_t |
---|
499 | |
---|
500 | #if PHOENIX_LIMIT > 9 |
---|
501 | , typename J = nil_t |
---|
502 | , typename K = nil_t |
---|
503 | , typename L = nil_t |
---|
504 | |
---|
505 | #if PHOENIX_LIMIT > 12 |
---|
506 | , typename M = nil_t |
---|
507 | , typename N = nil_t |
---|
508 | , typename O = nil_t |
---|
509 | |
---|
510 | #endif |
---|
511 | #endif |
---|
512 | #endif |
---|
513 | #endif |
---|
514 | |
---|
515 | , typename NU = nil_t // Not used |
---|
516 | > |
---|
517 | struct function_ptr_action; |
---|
518 | |
---|
519 | ////////////////////////////////// |
---|
520 | template < |
---|
521 | typename RT |
---|
522 | , typename A = nil_t |
---|
523 | , typename B = nil_t |
---|
524 | , typename C = nil_t |
---|
525 | |
---|
526 | #if PHOENIX_LIMIT > 3 |
---|
527 | , typename D = nil_t |
---|
528 | , typename E = nil_t |
---|
529 | , typename F = nil_t |
---|
530 | |
---|
531 | #if PHOENIX_LIMIT > 6 |
---|
532 | , typename G = nil_t |
---|
533 | , typename H = nil_t |
---|
534 | , typename I = nil_t |
---|
535 | |
---|
536 | #if PHOENIX_LIMIT > 9 |
---|
537 | , typename J = nil_t |
---|
538 | , typename K = nil_t |
---|
539 | , typename L = nil_t |
---|
540 | |
---|
541 | #if PHOENIX_LIMIT > 12 |
---|
542 | , typename M = nil_t |
---|
543 | , typename N = nil_t |
---|
544 | , typename O = nil_t |
---|
545 | |
---|
546 | #endif |
---|
547 | #endif |
---|
548 | #endif |
---|
549 | #endif |
---|
550 | > |
---|
551 | struct function_ptr |
---|
552 | : public function<function_ptr_action<RT |
---|
553 | , A, B, C |
---|
554 | #if PHOENIX_LIMIT > 3 |
---|
555 | , D, E, F |
---|
556 | #if PHOENIX_LIMIT > 6 |
---|
557 | , G, H, I |
---|
558 | #if PHOENIX_LIMIT > 9 |
---|
559 | , J, K, L |
---|
560 | #if PHOENIX_LIMIT > 12 |
---|
561 | , M, N, O |
---|
562 | #endif |
---|
563 | #endif |
---|
564 | #endif |
---|
565 | #endif |
---|
566 | > > { |
---|
567 | |
---|
568 | typedef function_ptr_action<RT |
---|
569 | , A, B, C |
---|
570 | #if PHOENIX_LIMIT > 3 |
---|
571 | , D, E, F |
---|
572 | #if PHOENIX_LIMIT > 6 |
---|
573 | , G, H, I |
---|
574 | #if PHOENIX_LIMIT > 9 |
---|
575 | , J, K, L |
---|
576 | #if PHOENIX_LIMIT > 12 |
---|
577 | , M, N, O |
---|
578 | #endif |
---|
579 | #endif |
---|
580 | #endif |
---|
581 | #endif |
---|
582 | > action_t; |
---|
583 | |
---|
584 | template <typename FPT> |
---|
585 | function_ptr(FPT fp) |
---|
586 | : function<action_t>(action_t(fp)) {} |
---|
587 | }; |
---|
588 | |
---|
589 | /////////////////////////////////////////////////////////////////////////////// |
---|
590 | // |
---|
591 | // Function pointer binder (specialization for 0 arg) |
---|
592 | // |
---|
593 | /////////////////////////////////////////////////////////////////////////////// |
---|
594 | template <typename RT> |
---|
595 | struct function_ptr_action<RT, |
---|
596 | nil_t, nil_t, nil_t, |
---|
597 | #if PHOENIX_LIMIT > 3 |
---|
598 | nil_t, nil_t, nil_t, |
---|
599 | #if PHOENIX_LIMIT > 6 |
---|
600 | nil_t, nil_t, nil_t, |
---|
601 | #if PHOENIX_LIMIT > 9 |
---|
602 | nil_t, nil_t, nil_t, |
---|
603 | #if PHOENIX_LIMIT > 12 |
---|
604 | nil_t, nil_t, nil_t, |
---|
605 | #endif |
---|
606 | #endif |
---|
607 | #endif |
---|
608 | #endif |
---|
609 | nil_t // Unused |
---|
610 | > { |
---|
611 | |
---|
612 | typedef RT result_type; |
---|
613 | typedef RT(*func_ptr_t)(); |
---|
614 | |
---|
615 | function_ptr_action(func_ptr_t fptr_) |
---|
616 | : fptr(fptr_) {} |
---|
617 | |
---|
618 | result_type operator()() const |
---|
619 | { return fptr(); } |
---|
620 | |
---|
621 | func_ptr_t fptr; |
---|
622 | }; |
---|
623 | |
---|
624 | ////////////////////////////////// |
---|
625 | template <typename RT> |
---|
626 | inline function_ptr<RT> |
---|
627 | bind(RT(*fptr)()) |
---|
628 | { |
---|
629 | return function_ptr<RT>(fptr); |
---|
630 | } |
---|
631 | |
---|
632 | /////////////////////////////////////////////////////////////////////////////// |
---|
633 | // |
---|
634 | // Function pointer binder (specialization for 1 arg) |
---|
635 | // |
---|
636 | /////////////////////////////////////////////////////////////////////////////// |
---|
637 | template <typename RT, typename A> |
---|
638 | struct function_ptr_action<RT, |
---|
639 | A, nil_t, nil_t, |
---|
640 | #if PHOENIX_LIMIT > 3 |
---|
641 | nil_t, nil_t, nil_t, |
---|
642 | #if PHOENIX_LIMIT > 6 |
---|
643 | nil_t, nil_t, nil_t, |
---|
644 | #if PHOENIX_LIMIT > 9 |
---|
645 | nil_t, nil_t, nil_t, |
---|
646 | #if PHOENIX_LIMIT > 12 |
---|
647 | nil_t, nil_t, nil_t, |
---|
648 | #endif |
---|
649 | #endif |
---|
650 | #endif |
---|
651 | #endif |
---|
652 | nil_t // Unused |
---|
653 | > { |
---|
654 | |
---|
655 | typedef RT result_type; |
---|
656 | typedef RT(*func_ptr_t)(A); |
---|
657 | |
---|
658 | template <typename A_> |
---|
659 | struct result { typedef result_type type; }; |
---|
660 | |
---|
661 | function_ptr_action(func_ptr_t fptr_) |
---|
662 | : fptr(fptr_) {} |
---|
663 | |
---|
664 | result_type operator()(A a) const |
---|
665 | { return fptr(a); } |
---|
666 | |
---|
667 | func_ptr_t fptr; |
---|
668 | }; |
---|
669 | |
---|
670 | ////////////////////////////////// |
---|
671 | template <typename RT, typename A> |
---|
672 | inline function_ptr<RT, A> |
---|
673 | bind(RT(*fptr)(A)) |
---|
674 | { |
---|
675 | return function_ptr<RT, A>(fptr); |
---|
676 | } |
---|
677 | |
---|
678 | /////////////////////////////////////////////////////////////////////////////// |
---|
679 | // |
---|
680 | // Function pointer binder (specialization for 2 args) |
---|
681 | // |
---|
682 | /////////////////////////////////////////////////////////////////////////////// |
---|
683 | template <typename RT, typename A, typename B> |
---|
684 | struct function_ptr_action<RT, |
---|
685 | A, B, nil_t, |
---|
686 | #if PHOENIX_LIMIT > 3 |
---|
687 | nil_t, nil_t, nil_t, |
---|
688 | #if PHOENIX_LIMIT > 6 |
---|
689 | nil_t, nil_t, nil_t, |
---|
690 | #if PHOENIX_LIMIT > 9 |
---|
691 | nil_t, nil_t, nil_t, |
---|
692 | #if PHOENIX_LIMIT > 12 |
---|
693 | nil_t, nil_t, nil_t, |
---|
694 | #endif |
---|
695 | #endif |
---|
696 | #endif |
---|
697 | #endif |
---|
698 | nil_t // Unused |
---|
699 | > { |
---|
700 | |
---|
701 | typedef RT result_type; |
---|
702 | typedef RT(*func_ptr_t)(A, B); |
---|
703 | |
---|
704 | template <typename A_, typename B_> |
---|
705 | struct result { typedef result_type type; }; |
---|
706 | |
---|
707 | function_ptr_action(func_ptr_t fptr_) |
---|
708 | : fptr(fptr_) {} |
---|
709 | |
---|
710 | result_type operator()(A a, B b) const |
---|
711 | { return fptr(a, b); } |
---|
712 | |
---|
713 | func_ptr_t fptr; |
---|
714 | }; |
---|
715 | |
---|
716 | ////////////////////////////////// |
---|
717 | template <typename RT, typename A, typename B> |
---|
718 | inline function_ptr<RT, A, B> |
---|
719 | bind(RT(*fptr)(A, B)) |
---|
720 | { |
---|
721 | return function_ptr<RT, A, B>(fptr); |
---|
722 | } |
---|
723 | |
---|
724 | /////////////////////////////////////////////////////////////////////////////// |
---|
725 | // |
---|
726 | // Function pointer binder (specialization for 3 args) |
---|
727 | // |
---|
728 | /////////////////////////////////////////////////////////////////////////////// |
---|
729 | template <typename RT, typename A, typename B, typename C> |
---|
730 | struct function_ptr_action<RT, |
---|
731 | A, B, C, |
---|
732 | #if PHOENIX_LIMIT > 3 |
---|
733 | nil_t, nil_t, nil_t, |
---|
734 | #if PHOENIX_LIMIT > 6 |
---|
735 | nil_t, nil_t, nil_t, |
---|
736 | #if PHOENIX_LIMIT > 9 |
---|
737 | nil_t, nil_t, nil_t, |
---|
738 | #if PHOENIX_LIMIT > 12 |
---|
739 | nil_t, nil_t, nil_t, |
---|
740 | #endif |
---|
741 | #endif |
---|
742 | #endif |
---|
743 | #endif |
---|
744 | nil_t // Unused |
---|
745 | > { |
---|
746 | |
---|
747 | typedef RT result_type; |
---|
748 | typedef RT(*func_ptr_t)(A, B, C); |
---|
749 | |
---|
750 | template <typename A_, typename B_, typename C_> |
---|
751 | struct result { typedef result_type type; }; |
---|
752 | |
---|
753 | function_ptr_action(func_ptr_t fptr_) |
---|
754 | : fptr(fptr_) {} |
---|
755 | |
---|
756 | result_type operator()(A a, B b, C c) const |
---|
757 | { return fptr(a, b, c); } |
---|
758 | |
---|
759 | func_ptr_t fptr; |
---|
760 | }; |
---|
761 | |
---|
762 | ////////////////////////////////// |
---|
763 | template <typename RT, typename A, typename B, typename C> |
---|
764 | inline function_ptr<RT, A, B, C> |
---|
765 | bind(RT(*fptr)(A, B, C)) |
---|
766 | { |
---|
767 | return function_ptr<RT, A, B, C>(fptr); |
---|
768 | } |
---|
769 | |
---|
770 | #if PHOENIX_LIMIT > 3 |
---|
771 | /////////////////////////////////////////////////////////////////////////////// |
---|
772 | // |
---|
773 | // Function pointer binder (specialization for 4 args) |
---|
774 | // |
---|
775 | /////////////////////////////////////////////////////////////////////////////// |
---|
776 | template <typename RT, typename A, typename B, typename C, typename D> |
---|
777 | struct function_ptr_action<RT, |
---|
778 | A, B, C, D, nil_t, nil_t, |
---|
779 | #if PHOENIX_LIMIT > 6 |
---|
780 | nil_t, nil_t, nil_t, |
---|
781 | #if PHOENIX_LIMIT > 9 |
---|
782 | nil_t, nil_t, nil_t, |
---|
783 | #if PHOENIX_LIMIT > 12 |
---|
784 | nil_t, nil_t, nil_t, |
---|
785 | #endif |
---|
786 | #endif |
---|
787 | #endif |
---|
788 | nil_t // Unused |
---|
789 | > { |
---|
790 | |
---|
791 | typedef RT result_type; |
---|
792 | typedef RT(*func_ptr_t)(A, B, C, D); |
---|
793 | |
---|
794 | template <typename A_, typename B_, typename C_, typename D_> |
---|
795 | struct result { typedef result_type type; }; |
---|
796 | |
---|
797 | function_ptr_action(func_ptr_t fptr_) |
---|
798 | : fptr(fptr_) {} |
---|
799 | |
---|
800 | result_type operator()(A a, B b, C c, D d) const |
---|
801 | { return fptr(a, b, c, d); } |
---|
802 | |
---|
803 | func_ptr_t fptr; |
---|
804 | }; |
---|
805 | |
---|
806 | ////////////////////////////////// |
---|
807 | template <typename RT, typename A, typename B, typename C, typename D> |
---|
808 | inline function_ptr<RT, A, B, C, D> |
---|
809 | bind(RT(*fptr)(A, B, C, D)) |
---|
810 | { |
---|
811 | return function_ptr<RT, A, B, C, D>(fptr); |
---|
812 | } |
---|
813 | |
---|
814 | /////////////////////////////////////////////////////////////////////////////// |
---|
815 | // |
---|
816 | // Function pointer binder (specialization for 5 args) |
---|
817 | // |
---|
818 | /////////////////////////////////////////////////////////////////////////////// |
---|
819 | template <typename RT, |
---|
820 | typename A, typename B, typename C, typename D, typename E |
---|
821 | > |
---|
822 | struct function_ptr_action<RT, |
---|
823 | A, B, C, D, E, nil_t, |
---|
824 | #if PHOENIX_LIMIT > 6 |
---|
825 | nil_t, nil_t, nil_t, |
---|
826 | #if PHOENIX_LIMIT > 9 |
---|
827 | nil_t, nil_t, nil_t, |
---|
828 | #if PHOENIX_LIMIT > 12 |
---|
829 | nil_t, nil_t, nil_t, |
---|
830 | #endif |
---|
831 | #endif |
---|
832 | #endif |
---|
833 | nil_t // Unused |
---|
834 | > { |
---|
835 | |
---|
836 | typedef RT result_type; |
---|
837 | typedef RT(*func_ptr_t)(A, B, C, D, E); |
---|
838 | |
---|
839 | template < |
---|
840 | typename A_, typename B_, typename C_, typename D_, typename E_ |
---|
841 | > |
---|
842 | struct result { typedef result_type type; }; |
---|
843 | |
---|
844 | function_ptr_action(func_ptr_t fptr_) |
---|
845 | : fptr(fptr_) {} |
---|
846 | |
---|
847 | result_type operator()( |
---|
848 | A a, B b, C c, D d, E e |
---|
849 | ) const |
---|
850 | { return fptr(a, b, c, d, e); } |
---|
851 | |
---|
852 | func_ptr_t fptr; |
---|
853 | }; |
---|
854 | |
---|
855 | ////////////////////////////////// |
---|
856 | template <typename RT, |
---|
857 | typename A, typename B, typename C, typename D, typename E |
---|
858 | > |
---|
859 | inline function_ptr<RT, A, B, C, D, E> |
---|
860 | bind(RT(*fptr)(A, B, C, D, E)) |
---|
861 | { |
---|
862 | return function_ptr<RT, A, B, C, D, E>(fptr); |
---|
863 | } |
---|
864 | |
---|
865 | /////////////////////////////////////////////////////////////////////////////// |
---|
866 | // |
---|
867 | // Function pointer binder (specialization for 6 args) |
---|
868 | // |
---|
869 | /////////////////////////////////////////////////////////////////////////////// |
---|
870 | template <typename RT, |
---|
871 | typename A, typename B, typename C, typename D, typename E, |
---|
872 | typename F |
---|
873 | > |
---|
874 | struct function_ptr_action<RT, |
---|
875 | A, B, C, D, E, F, |
---|
876 | #if PHOENIX_LIMIT > 6 |
---|
877 | nil_t, nil_t, nil_t, |
---|
878 | #if PHOENIX_LIMIT > 9 |
---|
879 | nil_t, nil_t, nil_t, |
---|
880 | #if PHOENIX_LIMIT > 12 |
---|
881 | nil_t, nil_t, nil_t, |
---|
882 | #endif |
---|
883 | #endif |
---|
884 | #endif |
---|
885 | nil_t // Unused |
---|
886 | > { |
---|
887 | |
---|
888 | typedef RT result_type; |
---|
889 | typedef RT(*func_ptr_t)(A, B, C, D, E, F); |
---|
890 | |
---|
891 | template < |
---|
892 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
893 | typename F_ |
---|
894 | > |
---|
895 | struct result { typedef result_type type; }; |
---|
896 | |
---|
897 | function_ptr_action(func_ptr_t fptr_) |
---|
898 | : fptr(fptr_) {} |
---|
899 | |
---|
900 | result_type operator()( |
---|
901 | A a, B b, C c, D d, E e, |
---|
902 | F f |
---|
903 | ) const |
---|
904 | { return fptr(a, b, c, d, e, f); } |
---|
905 | |
---|
906 | func_ptr_t fptr; |
---|
907 | }; |
---|
908 | |
---|
909 | ////////////////////////////////// |
---|
910 | template <typename RT, |
---|
911 | typename A, typename B, typename C, typename D, typename E, |
---|
912 | typename F |
---|
913 | > |
---|
914 | inline function_ptr<RT, A, B, C, D, E, F> |
---|
915 | bind(RT(*fptr)(A, B, C, D, E, F)) |
---|
916 | { |
---|
917 | return function_ptr<RT, A, B, C, D, E, F>(fptr); |
---|
918 | } |
---|
919 | |
---|
920 | #if PHOENIX_LIMIT > 6 |
---|
921 | /////////////////////////////////////////////////////////////////////////////// |
---|
922 | // |
---|
923 | // Function pointer binder (specialization for 7 args) |
---|
924 | // |
---|
925 | /////////////////////////////////////////////////////////////////////////////// |
---|
926 | template <typename RT, |
---|
927 | typename A, typename B, typename C, typename D, typename E, |
---|
928 | typename F, typename G |
---|
929 | > |
---|
930 | struct function_ptr_action<RT, |
---|
931 | A, B, C, D, E, F, G, nil_t, nil_t, |
---|
932 | #if PHOENIX_LIMIT > 9 |
---|
933 | nil_t, nil_t, nil_t, |
---|
934 | #if PHOENIX_LIMIT > 12 |
---|
935 | nil_t, nil_t, nil_t, |
---|
936 | #endif |
---|
937 | #endif |
---|
938 | nil_t // Unused |
---|
939 | > { |
---|
940 | |
---|
941 | typedef RT result_type; |
---|
942 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G); |
---|
943 | |
---|
944 | template < |
---|
945 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
946 | typename F_, typename G_ |
---|
947 | > |
---|
948 | struct result { typedef result_type type; }; |
---|
949 | |
---|
950 | function_ptr_action(func_ptr_t fptr_) |
---|
951 | : fptr(fptr_) {} |
---|
952 | |
---|
953 | result_type operator()( |
---|
954 | A a, B b, C c, D d, E e, |
---|
955 | F f, G g |
---|
956 | ) const |
---|
957 | { return fptr(a, b, c, d, e, f, g); } |
---|
958 | |
---|
959 | func_ptr_t fptr; |
---|
960 | }; |
---|
961 | |
---|
962 | ////////////////////////////////// |
---|
963 | template <typename RT, |
---|
964 | typename A, typename B, typename C, typename D, typename E, |
---|
965 | typename F, typename G |
---|
966 | > |
---|
967 | inline function_ptr<RT, A, B, C, D, E, F, G> |
---|
968 | bind(RT(*fptr)(A, B, C, D, E, F, G)) |
---|
969 | { |
---|
970 | return function_ptr<RT, A, B, C, D, E, F, G>(fptr); |
---|
971 | } |
---|
972 | |
---|
973 | /////////////////////////////////////////////////////////////////////////////// |
---|
974 | // |
---|
975 | // Function pointer binder (specialization for 8 args) |
---|
976 | // |
---|
977 | /////////////////////////////////////////////////////////////////////////////// |
---|
978 | template <typename RT, |
---|
979 | typename A, typename B, typename C, typename D, typename E, |
---|
980 | typename F, typename G, typename H |
---|
981 | > |
---|
982 | struct function_ptr_action<RT, |
---|
983 | A, B, C, D, E, F, G, H, nil_t, |
---|
984 | #if PHOENIX_LIMIT > 9 |
---|
985 | nil_t, nil_t, nil_t, |
---|
986 | #if PHOENIX_LIMIT > 12 |
---|
987 | nil_t, nil_t, nil_t, |
---|
988 | #endif |
---|
989 | #endif |
---|
990 | nil_t // Unused |
---|
991 | > { |
---|
992 | |
---|
993 | typedef RT result_type; |
---|
994 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H); |
---|
995 | |
---|
996 | template < |
---|
997 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
998 | typename F_, typename G_, typename H_ |
---|
999 | > |
---|
1000 | struct result { typedef result_type type; }; |
---|
1001 | |
---|
1002 | function_ptr_action(func_ptr_t fptr_) |
---|
1003 | : fptr(fptr_) {} |
---|
1004 | |
---|
1005 | result_type operator()( |
---|
1006 | A a, B b, C c, D d, E e, |
---|
1007 | F f, G g, H h |
---|
1008 | ) const |
---|
1009 | { return fptr(a, b, c, d, e, f, g, h); } |
---|
1010 | |
---|
1011 | func_ptr_t fptr; |
---|
1012 | }; |
---|
1013 | |
---|
1014 | ////////////////////////////////// |
---|
1015 | template <typename RT, |
---|
1016 | typename A, typename B, typename C, typename D, typename E, |
---|
1017 | typename F, typename G, typename H |
---|
1018 | > |
---|
1019 | inline function_ptr<RT, A, B, C, D, E, F, G, H> |
---|
1020 | bind(RT(*fptr)(A, B, C, D, E, F, G, H)) |
---|
1021 | { |
---|
1022 | return function_ptr<RT, A, B, C, D, E, F, G, H>(fptr); |
---|
1023 | } |
---|
1024 | |
---|
1025 | /////////////////////////////////////////////////////////////////////////////// |
---|
1026 | // |
---|
1027 | // Function pointer binder (specialization for 9 args) |
---|
1028 | // |
---|
1029 | /////////////////////////////////////////////////////////////////////////////// |
---|
1030 | template <typename RT, |
---|
1031 | typename A, typename B, typename C, typename D, typename E, |
---|
1032 | typename F, typename G, typename H, typename I |
---|
1033 | > |
---|
1034 | struct function_ptr_action<RT, |
---|
1035 | A, B, C, D, E, F, G, H, I, |
---|
1036 | #if PHOENIX_LIMIT > 9 |
---|
1037 | nil_t, nil_t, nil_t, |
---|
1038 | #if PHOENIX_LIMIT > 12 |
---|
1039 | nil_t, nil_t, nil_t, |
---|
1040 | #endif |
---|
1041 | #endif |
---|
1042 | nil_t // Unused |
---|
1043 | > { |
---|
1044 | |
---|
1045 | typedef RT result_type; |
---|
1046 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I); |
---|
1047 | |
---|
1048 | template < |
---|
1049 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1050 | typename F_, typename G_, typename H_, typename I_ |
---|
1051 | > |
---|
1052 | struct result { typedef result_type type; }; |
---|
1053 | |
---|
1054 | function_ptr_action(func_ptr_t fptr_) |
---|
1055 | : fptr(fptr_) {} |
---|
1056 | |
---|
1057 | result_type operator()( |
---|
1058 | A a, B b, C c, D d, E e, |
---|
1059 | F f, G g, H h, I i |
---|
1060 | ) const |
---|
1061 | { return fptr(a, b, c, d, e, f, g, h, i); } |
---|
1062 | |
---|
1063 | func_ptr_t fptr; |
---|
1064 | }; |
---|
1065 | |
---|
1066 | ////////////////////////////////// |
---|
1067 | template <typename RT, |
---|
1068 | typename A, typename B, typename C, typename D, typename E, |
---|
1069 | typename F, typename G, typename H, typename I |
---|
1070 | > |
---|
1071 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I> |
---|
1072 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I)) |
---|
1073 | { |
---|
1074 | return function_ptr<RT, A, B, C, D, E, F, G, H, I>(fptr); |
---|
1075 | } |
---|
1076 | |
---|
1077 | #if PHOENIX_LIMIT > 9 |
---|
1078 | /////////////////////////////////////////////////////////////////////////////// |
---|
1079 | // |
---|
1080 | // Function pointer binder (specialization for 10 args) |
---|
1081 | // |
---|
1082 | /////////////////////////////////////////////////////////////////////////////// |
---|
1083 | template <typename RT, |
---|
1084 | typename A, typename B, typename C, typename D, typename E, |
---|
1085 | typename F, typename G, typename H, typename I, typename J |
---|
1086 | > |
---|
1087 | struct function_ptr_action<RT, |
---|
1088 | A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, |
---|
1089 | #if PHOENIX_LIMIT > 12 |
---|
1090 | nil_t, nil_t, nil_t, |
---|
1091 | #endif |
---|
1092 | nil_t // Unused |
---|
1093 | > { |
---|
1094 | |
---|
1095 | typedef RT result_type; |
---|
1096 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J); |
---|
1097 | |
---|
1098 | template < |
---|
1099 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1100 | typename F_, typename G_, typename H_, typename I_, typename J_ |
---|
1101 | > |
---|
1102 | struct result { typedef result_type type; }; |
---|
1103 | |
---|
1104 | function_ptr_action(func_ptr_t fptr_) |
---|
1105 | : fptr(fptr_) {} |
---|
1106 | |
---|
1107 | result_type operator()( |
---|
1108 | A a, B b, C c, D d, E e, |
---|
1109 | F f, G g, H h, I i, J j |
---|
1110 | ) const |
---|
1111 | { return fptr(a, b, c, d, e, f, g, h, i, j); } |
---|
1112 | |
---|
1113 | func_ptr_t fptr; |
---|
1114 | }; |
---|
1115 | |
---|
1116 | ////////////////////////////////// |
---|
1117 | template <typename RT, |
---|
1118 | typename A, typename B, typename C, typename D, typename E, |
---|
1119 | typename F, typename G, typename H, typename I, typename J |
---|
1120 | > |
---|
1121 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J> |
---|
1122 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J)) |
---|
1123 | { |
---|
1124 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J>(fptr); |
---|
1125 | } |
---|
1126 | |
---|
1127 | /////////////////////////////////////////////////////////////////////////////// |
---|
1128 | // |
---|
1129 | // Function pointer binder (specialization for 11 args) |
---|
1130 | // |
---|
1131 | /////////////////////////////////////////////////////////////////////////////// |
---|
1132 | template <typename RT, |
---|
1133 | typename A, typename B, typename C, typename D, typename E, |
---|
1134 | typename F, typename G, typename H, typename I, typename J, |
---|
1135 | typename K |
---|
1136 | > |
---|
1137 | struct function_ptr_action<RT, |
---|
1138 | A, B, C, D, E, F, G, H, I, J, K, nil_t, |
---|
1139 | #if PHOENIX_LIMIT > 12 |
---|
1140 | nil_t, nil_t, nil_t, |
---|
1141 | #endif |
---|
1142 | nil_t // Unused |
---|
1143 | > { |
---|
1144 | |
---|
1145 | typedef RT result_type; |
---|
1146 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K); |
---|
1147 | |
---|
1148 | template < |
---|
1149 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1150 | typename F_, typename G_, typename H_, typename I_, typename J_, |
---|
1151 | typename K_ |
---|
1152 | > |
---|
1153 | struct result { typedef result_type type; }; |
---|
1154 | |
---|
1155 | function_ptr_action(func_ptr_t fptr_) |
---|
1156 | : fptr(fptr_) {} |
---|
1157 | |
---|
1158 | result_type operator()( |
---|
1159 | A a, B b, C c, D d, E e, |
---|
1160 | F f, G g, H h, I i, J j, |
---|
1161 | K k |
---|
1162 | ) const |
---|
1163 | { return fptr(a, b, c, d, e, f, g, h, i, j, k); } |
---|
1164 | |
---|
1165 | func_ptr_t fptr; |
---|
1166 | }; |
---|
1167 | |
---|
1168 | ////////////////////////////////// |
---|
1169 | template <typename RT, |
---|
1170 | typename A, typename B, typename C, typename D, typename E, |
---|
1171 | typename F, typename G, typename H, typename I, typename J, |
---|
1172 | typename K |
---|
1173 | > |
---|
1174 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K> |
---|
1175 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K)) |
---|
1176 | { |
---|
1177 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K>(fptr); |
---|
1178 | } |
---|
1179 | |
---|
1180 | /////////////////////////////////////////////////////////////////////////////// |
---|
1181 | // |
---|
1182 | // Function pointer binder (specialization for 12 args) |
---|
1183 | // |
---|
1184 | /////////////////////////////////////////////////////////////////////////////// |
---|
1185 | template <typename RT, |
---|
1186 | typename A, typename B, typename C, typename D, typename E, |
---|
1187 | typename F, typename G, typename H, typename I, typename J, |
---|
1188 | typename K, typename L |
---|
1189 | > |
---|
1190 | struct function_ptr_action<RT, |
---|
1191 | A, B, C, D, E, F, G, H, I, J, K, L, |
---|
1192 | #if PHOENIX_LIMIT > 12 |
---|
1193 | nil_t, nil_t, nil_t, |
---|
1194 | #endif |
---|
1195 | nil_t // Unused |
---|
1196 | > { |
---|
1197 | |
---|
1198 | typedef RT result_type; |
---|
1199 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L); |
---|
1200 | |
---|
1201 | template < |
---|
1202 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1203 | typename F_, typename G_, typename H_, typename I_, typename J_, |
---|
1204 | typename K_, typename L_ |
---|
1205 | > |
---|
1206 | struct result { typedef result_type type; }; |
---|
1207 | |
---|
1208 | function_ptr_action(func_ptr_t fptr_) |
---|
1209 | : fptr(fptr_) {} |
---|
1210 | |
---|
1211 | result_type operator()( |
---|
1212 | A a, B b, C c, D d, E e, |
---|
1213 | F f, G g, H h, I i, J j, |
---|
1214 | K k, L l |
---|
1215 | ) const |
---|
1216 | { return fptr(a, b, c, d, e, f, g, h, i, j, k, l); } |
---|
1217 | |
---|
1218 | func_ptr_t fptr; |
---|
1219 | }; |
---|
1220 | |
---|
1221 | ////////////////////////////////// |
---|
1222 | template <typename RT, |
---|
1223 | typename A, typename B, typename C, typename D, typename E, |
---|
1224 | typename F, typename G, typename H, typename I, typename J, |
---|
1225 | typename K, typename L |
---|
1226 | > |
---|
1227 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
1228 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) |
---|
1229 | { |
---|
1230 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); |
---|
1231 | } |
---|
1232 | |
---|
1233 | #if PHOENIX_LIMIT > 12 |
---|
1234 | /////////////////////////////////////////////////////////////////////////////// |
---|
1235 | // |
---|
1236 | // Function pointer binder (specialization for 13 args) |
---|
1237 | // |
---|
1238 | /////////////////////////////////////////////////////////////////////////////// |
---|
1239 | template <typename RT, |
---|
1240 | typename A, typename B, typename C, typename D, typename E, |
---|
1241 | typename F, typename G, typename H, typename I, typename J, |
---|
1242 | typename K, typename L, typename M |
---|
1243 | > |
---|
1244 | struct function_ptr_action<RT, |
---|
1245 | A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { |
---|
1246 | |
---|
1247 | typedef RT result_type; |
---|
1248 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M); |
---|
1249 | |
---|
1250 | template < |
---|
1251 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1252 | typename F_, typename G_, typename H_, typename I_, typename J_, |
---|
1253 | typename K_, typename L_, typename M_ |
---|
1254 | > |
---|
1255 | struct result { typedef result_type type; }; |
---|
1256 | |
---|
1257 | function_ptr_action(func_ptr_t fptr_) |
---|
1258 | : fptr(fptr_) {} |
---|
1259 | |
---|
1260 | result_type operator()( |
---|
1261 | A a, B b, C c, D d, E e, |
---|
1262 | F f, G g, H h, I i, J j, |
---|
1263 | K k, L l, M m |
---|
1264 | ) const |
---|
1265 | { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m); } |
---|
1266 | |
---|
1267 | func_ptr_t fptr; |
---|
1268 | }; |
---|
1269 | |
---|
1270 | ////////////////////////////////// |
---|
1271 | template <typename RT, |
---|
1272 | typename A, typename B, typename C, typename D, typename E, |
---|
1273 | typename F, typename G, typename H, typename I, typename J, |
---|
1274 | typename K, typename L, typename M |
---|
1275 | > |
---|
1276 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
1277 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) |
---|
1278 | { |
---|
1279 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); |
---|
1280 | } |
---|
1281 | |
---|
1282 | /////////////////////////////////////////////////////////////////////////////// |
---|
1283 | // |
---|
1284 | // Function pointer binder (specialization for 14 args) |
---|
1285 | // |
---|
1286 | /////////////////////////////////////////////////////////////////////////////// |
---|
1287 | template <typename RT, |
---|
1288 | typename A, typename B, typename C, typename D, typename E, |
---|
1289 | typename F, typename G, typename H, typename I, typename J, |
---|
1290 | typename K, typename L, typename M, typename N |
---|
1291 | > |
---|
1292 | struct function_ptr_action<RT, |
---|
1293 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { |
---|
1294 | |
---|
1295 | typedef RT result_type; |
---|
1296 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); |
---|
1297 | |
---|
1298 | template < |
---|
1299 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1300 | typename F_, typename G_, typename H_, typename I_, typename J_, |
---|
1301 | typename K_, typename L_, typename M_, typename N_ |
---|
1302 | > |
---|
1303 | struct result { typedef result_type type; }; |
---|
1304 | |
---|
1305 | function_ptr_action(func_ptr_t fptr_) |
---|
1306 | : fptr(fptr_) {} |
---|
1307 | |
---|
1308 | result_type operator()( |
---|
1309 | A a, B b, C c, D d, E e, |
---|
1310 | F f, G g, H h, I i, J j, |
---|
1311 | K k, L l, M m, N n |
---|
1312 | ) const |
---|
1313 | { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m, n); } |
---|
1314 | |
---|
1315 | func_ptr_t fptr; |
---|
1316 | }; |
---|
1317 | |
---|
1318 | ////////////////////////////////// |
---|
1319 | template <typename RT, |
---|
1320 | typename A, typename B, typename C, typename D, typename E, |
---|
1321 | typename F, typename G, typename H, typename I, typename J, |
---|
1322 | typename K, typename L, typename M, typename N |
---|
1323 | > |
---|
1324 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
1325 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) |
---|
1326 | { |
---|
1327 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); |
---|
1328 | } |
---|
1329 | |
---|
1330 | /////////////////////////////////////////////////////////////////////////////// |
---|
1331 | // |
---|
1332 | // Function pointer binder (specialization for 15 args) |
---|
1333 | // |
---|
1334 | /////////////////////////////////////////////////////////////////////////////// |
---|
1335 | template <typename RT, |
---|
1336 | typename A, typename B, typename C, typename D, typename E, |
---|
1337 | typename F, typename G, typename H, typename I, typename J, |
---|
1338 | typename K, typename L, typename M, typename N, typename O |
---|
1339 | > |
---|
1340 | struct function_ptr_action<RT, |
---|
1341 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { |
---|
1342 | |
---|
1343 | typedef RT result_type; |
---|
1344 | typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); |
---|
1345 | |
---|
1346 | template < |
---|
1347 | typename A_, typename B_, typename C_, typename D_, typename E_, |
---|
1348 | typename F_, typename G_, typename H_, typename I_, typename J_, |
---|
1349 | typename K_, typename L_, typename M_, typename N_, typename O_ |
---|
1350 | > |
---|
1351 | struct result { typedef result_type type; }; |
---|
1352 | |
---|
1353 | function_ptr_action(func_ptr_t fptr_) |
---|
1354 | : fptr(fptr_) {} |
---|
1355 | |
---|
1356 | result_type operator()( |
---|
1357 | A a, B b, C c, D d, E e, |
---|
1358 | F f, G g, H h, I i, J j, |
---|
1359 | K k, L l, M m, N n, O o |
---|
1360 | ) const |
---|
1361 | { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); } |
---|
1362 | |
---|
1363 | func_ptr_t fptr; |
---|
1364 | }; |
---|
1365 | |
---|
1366 | ////////////////////////////////// |
---|
1367 | template <typename RT, |
---|
1368 | typename A, typename B, typename C, typename D, typename E, |
---|
1369 | typename F, typename G, typename H, typename I, typename J, |
---|
1370 | typename K, typename L, typename M, typename N, typename O |
---|
1371 | > |
---|
1372 | inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
1373 | bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) |
---|
1374 | { |
---|
1375 | return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); |
---|
1376 | } |
---|
1377 | |
---|
1378 | #endif |
---|
1379 | #endif |
---|
1380 | #endif |
---|
1381 | #endif |
---|
1382 | /////////////////////////////////////////////////////////////////////////////// |
---|
1383 | // |
---|
1384 | // Member function pointer binder (main class) |
---|
1385 | // |
---|
1386 | /////////////////////////////////////////////////////////////////////////////// |
---|
1387 | template < |
---|
1388 | typename RT, |
---|
1389 | typename ClassT |
---|
1390 | , typename A = nil_t |
---|
1391 | , typename B = nil_t |
---|
1392 | , typename C = nil_t |
---|
1393 | |
---|
1394 | #if PHOENIX_LIMIT > 3 |
---|
1395 | , typename D = nil_t |
---|
1396 | , typename E = nil_t |
---|
1397 | , typename F = nil_t |
---|
1398 | |
---|
1399 | #if PHOENIX_LIMIT > 6 |
---|
1400 | , typename G = nil_t |
---|
1401 | , typename H = nil_t |
---|
1402 | , typename I = nil_t |
---|
1403 | |
---|
1404 | #if PHOENIX_LIMIT > 9 |
---|
1405 | , typename J = nil_t |
---|
1406 | , typename K = nil_t |
---|
1407 | , typename L = nil_t |
---|
1408 | |
---|
1409 | #if PHOENIX_LIMIT > 12 |
---|
1410 | , typename M = nil_t |
---|
1411 | , typename N = nil_t |
---|
1412 | , typename O = nil_t |
---|
1413 | |
---|
1414 | #endif |
---|
1415 | #endif |
---|
1416 | #endif |
---|
1417 | #endif |
---|
1418 | |
---|
1419 | , typename NU = nil_t // Not used |
---|
1420 | > |
---|
1421 | struct member_function_ptr_action; |
---|
1422 | |
---|
1423 | ////////////////////////////////// |
---|
1424 | template < |
---|
1425 | typename RT, |
---|
1426 | typename ClassT |
---|
1427 | , typename A = nil_t |
---|
1428 | , typename B = nil_t |
---|
1429 | , typename C = nil_t |
---|
1430 | |
---|
1431 | #if PHOENIX_LIMIT > 3 |
---|
1432 | , typename D = nil_t |
---|
1433 | , typename E = nil_t |
---|
1434 | , typename F = nil_t |
---|
1435 | |
---|
1436 | #if PHOENIX_LIMIT > 6 |
---|
1437 | , typename G = nil_t |
---|
1438 | , typename H = nil_t |
---|
1439 | , typename I = nil_t |
---|
1440 | |
---|
1441 | #if PHOENIX_LIMIT > 9 |
---|
1442 | , typename J = nil_t |
---|
1443 | , typename K = nil_t |
---|
1444 | , typename L = nil_t |
---|
1445 | |
---|
1446 | #if PHOENIX_LIMIT > 12 |
---|
1447 | , typename M = nil_t |
---|
1448 | , typename N = nil_t |
---|
1449 | , typename O = nil_t |
---|
1450 | |
---|
1451 | #endif |
---|
1452 | #endif |
---|
1453 | #endif |
---|
1454 | #endif |
---|
1455 | > |
---|
1456 | struct member_function_ptr |
---|
1457 | : public function<member_function_ptr_action<RT, ClassT |
---|
1458 | , A, B, C |
---|
1459 | #if PHOENIX_LIMIT > 3 |
---|
1460 | , D, E, F |
---|
1461 | #if PHOENIX_LIMIT > 6 |
---|
1462 | , G, H, I |
---|
1463 | #if PHOENIX_LIMIT > 9 |
---|
1464 | , J, K, L |
---|
1465 | #if PHOENIX_LIMIT > 12 |
---|
1466 | , M, N, O |
---|
1467 | #endif |
---|
1468 | #endif |
---|
1469 | #endif |
---|
1470 | #endif |
---|
1471 | > > { |
---|
1472 | |
---|
1473 | typedef member_function_ptr_action<RT, ClassT |
---|
1474 | , A, B, C |
---|
1475 | #if PHOENIX_LIMIT > 3 |
---|
1476 | , D, E, F |
---|
1477 | #if PHOENIX_LIMIT > 6 |
---|
1478 | , G, H, I |
---|
1479 | #if PHOENIX_LIMIT > 9 |
---|
1480 | , J, K, L |
---|
1481 | #if PHOENIX_LIMIT > 12 |
---|
1482 | , M, N, O |
---|
1483 | #endif |
---|
1484 | #endif |
---|
1485 | #endif |
---|
1486 | #endif |
---|
1487 | > action_t; |
---|
1488 | |
---|
1489 | template <typename FPT> |
---|
1490 | member_function_ptr(FPT fp) |
---|
1491 | : function<action_t>(action_t(fp)) {} |
---|
1492 | }; |
---|
1493 | |
---|
1494 | /////////////////////////////////////////////////////////////////////////////// |
---|
1495 | // |
---|
1496 | // Member function pointer binder (specialization for 0 arg) |
---|
1497 | // |
---|
1498 | /////////////////////////////////////////////////////////////////////////////// |
---|
1499 | template <typename RT, typename ClassT> |
---|
1500 | struct member_function_ptr_action<RT, ClassT, |
---|
1501 | nil_t, nil_t, nil_t, |
---|
1502 | #if PHOENIX_LIMIT > 3 |
---|
1503 | nil_t, nil_t, nil_t, |
---|
1504 | #if PHOENIX_LIMIT > 6 |
---|
1505 | nil_t, nil_t, nil_t, |
---|
1506 | #if PHOENIX_LIMIT > 9 |
---|
1507 | nil_t, nil_t, nil_t, |
---|
1508 | #if PHOENIX_LIMIT > 12 |
---|
1509 | nil_t, nil_t, nil_t, |
---|
1510 | #endif |
---|
1511 | #endif |
---|
1512 | #endif |
---|
1513 | #endif |
---|
1514 | nil_t // Unused |
---|
1515 | > { |
---|
1516 | |
---|
1517 | typedef RT result_type; |
---|
1518 | typedef RT(ClassT::*mf)(); |
---|
1519 | typedef RT(ClassT::*cmf)() const; |
---|
1520 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1521 | mem_func_ptr_t; |
---|
1522 | |
---|
1523 | template <typename CT> |
---|
1524 | struct result { typedef result_type type; }; |
---|
1525 | |
---|
1526 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1527 | : fptr(fptr_) {} |
---|
1528 | |
---|
1529 | template <typename CT> |
---|
1530 | result_type operator()(CT& obj) const |
---|
1531 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(); } |
---|
1532 | |
---|
1533 | mem_func_ptr_t fptr; |
---|
1534 | }; |
---|
1535 | |
---|
1536 | ////////////////////////////////// |
---|
1537 | template <typename RT, typename ClassT> |
---|
1538 | inline member_function_ptr<RT, ClassT> |
---|
1539 | bind(RT(ClassT::*fptr)()) |
---|
1540 | { |
---|
1541 | return member_function_ptr<RT, ClassT>(fptr); |
---|
1542 | } |
---|
1543 | |
---|
1544 | template <typename RT, typename ClassT> |
---|
1545 | inline member_function_ptr<RT, ClassT const> |
---|
1546 | bind(RT(ClassT::*fptr)() const) |
---|
1547 | { |
---|
1548 | return member_function_ptr<RT, ClassT const>(fptr); |
---|
1549 | } |
---|
1550 | |
---|
1551 | /////////////////////////////////////////////////////////////////////////////// |
---|
1552 | // |
---|
1553 | // Member function pointer binder (specialization for 1 arg) |
---|
1554 | // |
---|
1555 | /////////////////////////////////////////////////////////////////////////////// |
---|
1556 | template <typename RT, typename ClassT, typename A> |
---|
1557 | struct member_function_ptr_action<RT, ClassT, |
---|
1558 | A, nil_t, nil_t, |
---|
1559 | #if PHOENIX_LIMIT > 3 |
---|
1560 | nil_t, nil_t, nil_t, |
---|
1561 | #if PHOENIX_LIMIT > 6 |
---|
1562 | nil_t, nil_t, nil_t, |
---|
1563 | #if PHOENIX_LIMIT > 9 |
---|
1564 | nil_t, nil_t, nil_t, |
---|
1565 | #if PHOENIX_LIMIT > 12 |
---|
1566 | nil_t, nil_t, nil_t, |
---|
1567 | #endif |
---|
1568 | #endif |
---|
1569 | #endif |
---|
1570 | #endif |
---|
1571 | nil_t // Unused |
---|
1572 | > { |
---|
1573 | |
---|
1574 | typedef RT result_type; |
---|
1575 | typedef RT(ClassT::*mf)(A); |
---|
1576 | typedef RT(ClassT::*cmf)(A) const; |
---|
1577 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1578 | mem_func_ptr_t; |
---|
1579 | |
---|
1580 | template <typename CT, typename A_> |
---|
1581 | struct result { typedef result_type type; }; |
---|
1582 | |
---|
1583 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1584 | : fptr(fptr_) {} |
---|
1585 | |
---|
1586 | template <typename CT> |
---|
1587 | result_type operator()(CT& obj, A a) const |
---|
1588 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a); } |
---|
1589 | |
---|
1590 | mem_func_ptr_t fptr; |
---|
1591 | }; |
---|
1592 | |
---|
1593 | ////////////////////////////////// |
---|
1594 | template <typename RT, typename ClassT, typename A> |
---|
1595 | inline member_function_ptr<RT, ClassT, A> |
---|
1596 | bind(RT(ClassT::*fptr)(A)) |
---|
1597 | { |
---|
1598 | return member_function_ptr<RT, ClassT, A>(fptr); |
---|
1599 | } |
---|
1600 | |
---|
1601 | ////////////////////////////////// |
---|
1602 | template <typename RT, typename ClassT, typename A> |
---|
1603 | inline member_function_ptr<RT, ClassT const, A> |
---|
1604 | bind(RT(ClassT::*fptr)(A) const) |
---|
1605 | { |
---|
1606 | return member_function_ptr<RT, ClassT const, A>(fptr); |
---|
1607 | } |
---|
1608 | |
---|
1609 | /////////////////////////////////////////////////////////////////////////////// |
---|
1610 | // |
---|
1611 | // Member function pointer binder (specialization for 2 args) |
---|
1612 | // |
---|
1613 | /////////////////////////////////////////////////////////////////////////////// |
---|
1614 | template <typename RT, typename ClassT, typename A, typename B> |
---|
1615 | struct member_function_ptr_action<RT, ClassT, |
---|
1616 | A, B, nil_t, |
---|
1617 | #if PHOENIX_LIMIT > 3 |
---|
1618 | nil_t, nil_t, nil_t, |
---|
1619 | #if PHOENIX_LIMIT > 6 |
---|
1620 | nil_t, nil_t, nil_t, |
---|
1621 | #if PHOENIX_LIMIT > 9 |
---|
1622 | nil_t, nil_t, nil_t, |
---|
1623 | #if PHOENIX_LIMIT > 12 |
---|
1624 | nil_t, nil_t, nil_t, |
---|
1625 | #endif |
---|
1626 | #endif |
---|
1627 | #endif |
---|
1628 | #endif |
---|
1629 | nil_t // Unused |
---|
1630 | > { |
---|
1631 | |
---|
1632 | typedef RT result_type; |
---|
1633 | typedef RT(ClassT::*mf)(A, B); |
---|
1634 | typedef RT(ClassT::*cmf)(A, B) const; |
---|
1635 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1636 | mem_func_ptr_t; |
---|
1637 | |
---|
1638 | template <typename CT, typename A_, typename B_> |
---|
1639 | struct result { typedef result_type type; }; |
---|
1640 | |
---|
1641 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1642 | : fptr(fptr_) {} |
---|
1643 | |
---|
1644 | template <typename CT> |
---|
1645 | result_type operator()(CT& obj, A a, B b) const |
---|
1646 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b); } |
---|
1647 | |
---|
1648 | mem_func_ptr_t fptr; |
---|
1649 | }; |
---|
1650 | |
---|
1651 | ////////////////////////////////// |
---|
1652 | template <typename RT, typename ClassT, typename A, typename B> |
---|
1653 | inline member_function_ptr<RT, ClassT, A, B> |
---|
1654 | bind(RT(ClassT::*fptr)(A, B)) |
---|
1655 | { |
---|
1656 | return member_function_ptr<RT, ClassT, A, B>(fptr); |
---|
1657 | } |
---|
1658 | |
---|
1659 | ////////////////////////////////// |
---|
1660 | template <typename RT, typename ClassT, typename A, typename B> |
---|
1661 | inline member_function_ptr<RT, ClassT const, A, B> |
---|
1662 | bind(RT(ClassT::*fptr)(A, B) const) |
---|
1663 | { |
---|
1664 | return member_function_ptr<RT, ClassT const, A, B>(fptr); |
---|
1665 | } |
---|
1666 | |
---|
1667 | #if PHOENIX_LIMIT > 3 |
---|
1668 | /////////////////////////////////////////////////////////////////////////////// |
---|
1669 | // |
---|
1670 | // Member function pointer binder (specialization for 3 args) |
---|
1671 | // |
---|
1672 | /////////////////////////////////////////////////////////////////////////////// |
---|
1673 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
1674 | struct member_function_ptr_action<RT, ClassT, |
---|
1675 | A, B, C, nil_t, nil_t, nil_t, |
---|
1676 | #if PHOENIX_LIMIT > 6 |
---|
1677 | nil_t, nil_t, nil_t, |
---|
1678 | #if PHOENIX_LIMIT > 9 |
---|
1679 | nil_t, nil_t, nil_t, |
---|
1680 | #if PHOENIX_LIMIT > 12 |
---|
1681 | nil_t, nil_t, nil_t, |
---|
1682 | #endif |
---|
1683 | #endif |
---|
1684 | #endif |
---|
1685 | nil_t // Unused |
---|
1686 | > { |
---|
1687 | |
---|
1688 | typedef RT result_type; |
---|
1689 | typedef RT(ClassT::*mf)(A, B, C); |
---|
1690 | typedef RT(ClassT::*cmf)(A, B, C) const; |
---|
1691 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1692 | mem_func_ptr_t; |
---|
1693 | |
---|
1694 | template <typename CT, typename A_, typename B_, typename C_> |
---|
1695 | struct result { typedef result_type type; }; |
---|
1696 | |
---|
1697 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1698 | : fptr(fptr_) {} |
---|
1699 | |
---|
1700 | template <typename CT> |
---|
1701 | result_type operator()(CT& obj, A a, B b, C c) const |
---|
1702 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c); } |
---|
1703 | |
---|
1704 | mem_func_ptr_t fptr; |
---|
1705 | }; |
---|
1706 | |
---|
1707 | ////////////////////////////////// |
---|
1708 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
1709 | inline member_function_ptr<RT, ClassT, A, B, C> |
---|
1710 | bind(RT(ClassT::*fptr)(A, B, C)) |
---|
1711 | { |
---|
1712 | return member_function_ptr<RT, ClassT, A, B, C>(fptr); |
---|
1713 | } |
---|
1714 | |
---|
1715 | ////////////////////////////////// |
---|
1716 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
1717 | inline member_function_ptr<RT, ClassT const, A, B, C> |
---|
1718 | bind(RT(ClassT::*fptr)(A, B, C) const) |
---|
1719 | { |
---|
1720 | return member_function_ptr<RT, ClassT const, A, B, C>(fptr); |
---|
1721 | } |
---|
1722 | |
---|
1723 | /////////////////////////////////////////////////////////////////////////////// |
---|
1724 | // |
---|
1725 | // Member function pointer binder (specialization for 4 args) |
---|
1726 | // |
---|
1727 | /////////////////////////////////////////////////////////////////////////////// |
---|
1728 | template <typename RT, typename ClassT, |
---|
1729 | typename A, typename B, typename C, typename D |
---|
1730 | > |
---|
1731 | struct member_function_ptr_action<RT, ClassT, |
---|
1732 | A, B, C, D, nil_t, nil_t, |
---|
1733 | #if PHOENIX_LIMIT > 6 |
---|
1734 | nil_t, nil_t, nil_t, |
---|
1735 | #if PHOENIX_LIMIT > 9 |
---|
1736 | nil_t, nil_t, nil_t, |
---|
1737 | #if PHOENIX_LIMIT > 12 |
---|
1738 | nil_t, nil_t, nil_t, |
---|
1739 | #endif |
---|
1740 | #endif |
---|
1741 | #endif |
---|
1742 | nil_t // Unused |
---|
1743 | > { |
---|
1744 | |
---|
1745 | typedef RT result_type; |
---|
1746 | typedef RT(ClassT::*mf)(A, B, C, D); |
---|
1747 | typedef RT(ClassT::*cmf)(A, B, C, D) const; |
---|
1748 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1749 | mem_func_ptr_t; |
---|
1750 | |
---|
1751 | template <typename CT, |
---|
1752 | typename A_, typename B_, typename C_, typename D_ |
---|
1753 | > |
---|
1754 | struct result { typedef result_type type; }; |
---|
1755 | |
---|
1756 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1757 | : fptr(fptr_) {} |
---|
1758 | |
---|
1759 | template <typename CT> |
---|
1760 | result_type operator()(CT& obj, |
---|
1761 | A a, B b, C c, D d |
---|
1762 | ) const |
---|
1763 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d); } |
---|
1764 | |
---|
1765 | mem_func_ptr_t fptr; |
---|
1766 | }; |
---|
1767 | |
---|
1768 | ////////////////////////////////// |
---|
1769 | template <typename RT, typename ClassT, |
---|
1770 | typename A, typename B, typename C, typename D |
---|
1771 | > |
---|
1772 | inline member_function_ptr<RT, ClassT, A, B, C, D> |
---|
1773 | bind(RT(ClassT::*fptr)(A, B, C, D)) |
---|
1774 | { |
---|
1775 | return member_function_ptr< |
---|
1776 | RT, ClassT, A, B, C, D>(fptr); |
---|
1777 | } |
---|
1778 | |
---|
1779 | ////////////////////////////////// |
---|
1780 | template <typename RT, typename ClassT, |
---|
1781 | typename A, typename B, typename C, typename D |
---|
1782 | > |
---|
1783 | inline member_function_ptr<RT, ClassT const, A, B, C, D> |
---|
1784 | bind(RT(ClassT::*fptr)(A, B, C, D) const) |
---|
1785 | { |
---|
1786 | return member_function_ptr< |
---|
1787 | RT, ClassT const, A, B, C, D>(fptr); |
---|
1788 | } |
---|
1789 | |
---|
1790 | /////////////////////////////////////////////////////////////////////////////// |
---|
1791 | // |
---|
1792 | // Member function pointer binder (specialization for 5 args) |
---|
1793 | // |
---|
1794 | /////////////////////////////////////////////////////////////////////////////// |
---|
1795 | template <typename RT, typename ClassT, |
---|
1796 | typename A, typename B, typename C, typename D, |
---|
1797 | typename E |
---|
1798 | > |
---|
1799 | struct member_function_ptr_action<RT, ClassT, |
---|
1800 | A, B, C, D, E, nil_t, |
---|
1801 | #if PHOENIX_LIMIT > 6 |
---|
1802 | nil_t, nil_t, nil_t, |
---|
1803 | #if PHOENIX_LIMIT > 9 |
---|
1804 | nil_t, nil_t, nil_t, |
---|
1805 | #if PHOENIX_LIMIT > 12 |
---|
1806 | nil_t, nil_t, nil_t, |
---|
1807 | #endif |
---|
1808 | #endif |
---|
1809 | #endif |
---|
1810 | nil_t // Unused |
---|
1811 | > { |
---|
1812 | |
---|
1813 | typedef RT result_type; |
---|
1814 | typedef RT(ClassT::*mf)(A, B, C, D, E); |
---|
1815 | typedef RT(ClassT::*cmf)(A, B, C, D, E) const; |
---|
1816 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1817 | mem_func_ptr_t; |
---|
1818 | |
---|
1819 | template <typename CT, |
---|
1820 | typename A_, typename B_, typename C_, typename D_, |
---|
1821 | typename E_ |
---|
1822 | > |
---|
1823 | struct result { typedef result_type type; }; |
---|
1824 | |
---|
1825 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1826 | : fptr(fptr_) {} |
---|
1827 | |
---|
1828 | template <typename CT> |
---|
1829 | result_type operator()(CT& obj, |
---|
1830 | A a, B b, C c, D d, E e |
---|
1831 | ) const |
---|
1832 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e); } |
---|
1833 | |
---|
1834 | mem_func_ptr_t fptr; |
---|
1835 | }; |
---|
1836 | |
---|
1837 | ////////////////////////////////// |
---|
1838 | template <typename RT, typename ClassT, |
---|
1839 | typename A, typename B, typename C, typename D, |
---|
1840 | typename E |
---|
1841 | > |
---|
1842 | inline member_function_ptr<RT, ClassT, A, B, C, D, E> |
---|
1843 | bind(RT(ClassT::*fptr)(A, B, C, D, E)) |
---|
1844 | { |
---|
1845 | return member_function_ptr< |
---|
1846 | RT, ClassT, A, B, C, D, E>(fptr); |
---|
1847 | } |
---|
1848 | |
---|
1849 | ////////////////////////////////// |
---|
1850 | template <typename RT, typename ClassT, |
---|
1851 | typename A, typename B, typename C, typename D, |
---|
1852 | typename E |
---|
1853 | > |
---|
1854 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E> |
---|
1855 | bind(RT(ClassT::*fptr)(A, B, C, D, E) const) |
---|
1856 | { |
---|
1857 | return member_function_ptr< |
---|
1858 | RT, ClassT const, A, B, C, D, E>(fptr); |
---|
1859 | } |
---|
1860 | |
---|
1861 | #if PHOENIX_LIMIT > 6 |
---|
1862 | /////////////////////////////////////////////////////////////////////////////// |
---|
1863 | // |
---|
1864 | // Member function pointer binder (specialization for 6 args) |
---|
1865 | // |
---|
1866 | /////////////////////////////////////////////////////////////////////////////// |
---|
1867 | template <typename RT, typename ClassT, |
---|
1868 | typename A, typename B, typename C, typename D, |
---|
1869 | typename E, typename F |
---|
1870 | > |
---|
1871 | struct member_function_ptr_action<RT, ClassT, |
---|
1872 | A, B, C, D, E, F, nil_t, nil_t, nil_t, |
---|
1873 | #if PHOENIX_LIMIT > 9 |
---|
1874 | nil_t, nil_t, nil_t, |
---|
1875 | #if PHOENIX_LIMIT > 12 |
---|
1876 | nil_t, nil_t, nil_t, |
---|
1877 | #endif |
---|
1878 | #endif |
---|
1879 | nil_t // Unused |
---|
1880 | > { |
---|
1881 | |
---|
1882 | typedef RT result_type; |
---|
1883 | typedef RT(ClassT::*mf)(A, B, C, D, E, F); |
---|
1884 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F) const; |
---|
1885 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1886 | mem_func_ptr_t; |
---|
1887 | |
---|
1888 | template <typename CT, |
---|
1889 | typename A_, typename B_, typename C_, typename D_, |
---|
1890 | typename E_, typename F_ |
---|
1891 | > |
---|
1892 | struct result { typedef result_type type; }; |
---|
1893 | |
---|
1894 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1895 | : fptr(fptr_) {} |
---|
1896 | |
---|
1897 | template <typename CT> |
---|
1898 | result_type operator()(CT& obj, |
---|
1899 | A a, B b, C c, D d, E e, F f |
---|
1900 | ) const |
---|
1901 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f); } |
---|
1902 | |
---|
1903 | mem_func_ptr_t fptr; |
---|
1904 | }; |
---|
1905 | |
---|
1906 | ////////////////////////////////// |
---|
1907 | template <typename RT, typename ClassT, |
---|
1908 | typename A, typename B, typename C, typename D, |
---|
1909 | typename E, typename F |
---|
1910 | > |
---|
1911 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F> |
---|
1912 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F)) |
---|
1913 | { |
---|
1914 | return member_function_ptr< |
---|
1915 | RT, ClassT, A, B, C, D, E, F>(fptr); |
---|
1916 | } |
---|
1917 | |
---|
1918 | ////////////////////////////////// |
---|
1919 | template <typename RT, typename ClassT, |
---|
1920 | typename A, typename B, typename C, typename D, |
---|
1921 | typename E, typename F |
---|
1922 | > |
---|
1923 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F> |
---|
1924 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F) const) |
---|
1925 | { |
---|
1926 | return member_function_ptr< |
---|
1927 | RT, ClassT const, A, B, C, D, E, F>(fptr); |
---|
1928 | } |
---|
1929 | |
---|
1930 | /////////////////////////////////////////////////////////////////////////////// |
---|
1931 | // |
---|
1932 | // Member function pointer binder (specialization for 7 args) |
---|
1933 | // |
---|
1934 | /////////////////////////////////////////////////////////////////////////////// |
---|
1935 | template <typename RT, typename ClassT, |
---|
1936 | typename A, typename B, typename C, typename D, |
---|
1937 | typename E, typename F, typename G |
---|
1938 | > |
---|
1939 | struct member_function_ptr_action<RT, ClassT, |
---|
1940 | A, B, C, D, E, F, G, nil_t, nil_t, |
---|
1941 | #if PHOENIX_LIMIT > 9 |
---|
1942 | nil_t, nil_t, nil_t, |
---|
1943 | #if PHOENIX_LIMIT > 12 |
---|
1944 | nil_t, nil_t, nil_t, |
---|
1945 | #endif |
---|
1946 | #endif |
---|
1947 | nil_t // Unused |
---|
1948 | > { |
---|
1949 | |
---|
1950 | typedef RT result_type; |
---|
1951 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G); |
---|
1952 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G) const; |
---|
1953 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
1954 | mem_func_ptr_t; |
---|
1955 | |
---|
1956 | template <typename CT, |
---|
1957 | typename A_, typename B_, typename C_, typename D_, |
---|
1958 | typename E_, typename F_, typename G_ |
---|
1959 | > |
---|
1960 | struct result { typedef result_type type; }; |
---|
1961 | |
---|
1962 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
1963 | : fptr(fptr_) {} |
---|
1964 | |
---|
1965 | template <typename CT> |
---|
1966 | result_type operator()(CT& obj, |
---|
1967 | A a, B b, C c, D d, E e, F f, G g |
---|
1968 | ) const |
---|
1969 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g); } |
---|
1970 | |
---|
1971 | mem_func_ptr_t fptr; |
---|
1972 | }; |
---|
1973 | |
---|
1974 | ////////////////////////////////// |
---|
1975 | template <typename RT, typename ClassT, |
---|
1976 | typename A, typename B, typename C, typename D, |
---|
1977 | typename E, typename F, typename G |
---|
1978 | > |
---|
1979 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G> |
---|
1980 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G)) |
---|
1981 | { |
---|
1982 | return member_function_ptr< |
---|
1983 | RT, ClassT, A, B, C, D, E, F, G>(fptr); |
---|
1984 | } |
---|
1985 | |
---|
1986 | ////////////////////////////////// |
---|
1987 | template <typename RT, typename ClassT, |
---|
1988 | typename A, typename B, typename C, typename D, |
---|
1989 | typename E, typename F, typename G |
---|
1990 | > |
---|
1991 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G> |
---|
1992 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) |
---|
1993 | { |
---|
1994 | return member_function_ptr< |
---|
1995 | RT, ClassT const, A, B, C, D, E, F, G>(fptr); |
---|
1996 | } |
---|
1997 | |
---|
1998 | /////////////////////////////////////////////////////////////////////////////// |
---|
1999 | // |
---|
2000 | // Member function pointer binder (specialization for 8 args) |
---|
2001 | // |
---|
2002 | /////////////////////////////////////////////////////////////////////////////// |
---|
2003 | template <typename RT, typename ClassT, |
---|
2004 | typename A, typename B, typename C, typename D, |
---|
2005 | typename E, typename F, typename G, typename H |
---|
2006 | > |
---|
2007 | struct member_function_ptr_action<RT, ClassT, |
---|
2008 | A, B, C, D, E, F, G, H, nil_t, |
---|
2009 | #if PHOENIX_LIMIT > 9 |
---|
2010 | nil_t, nil_t, nil_t, |
---|
2011 | #if PHOENIX_LIMIT > 12 |
---|
2012 | nil_t, nil_t, nil_t, |
---|
2013 | #endif |
---|
2014 | #endif |
---|
2015 | nil_t // Unused |
---|
2016 | > { |
---|
2017 | |
---|
2018 | typedef RT result_type; |
---|
2019 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H); |
---|
2020 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H) const; |
---|
2021 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2022 | mem_func_ptr_t; |
---|
2023 | |
---|
2024 | template <typename CT, |
---|
2025 | typename A_, typename B_, typename C_, typename D_, |
---|
2026 | typename E_, typename F_, typename G_, typename H_ |
---|
2027 | > |
---|
2028 | struct result { typedef result_type type; }; |
---|
2029 | |
---|
2030 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2031 | : fptr(fptr_) {} |
---|
2032 | |
---|
2033 | template <typename CT> |
---|
2034 | result_type operator()(CT& obj, |
---|
2035 | A a, B b, C c, D d, E e, F f, G g, H h |
---|
2036 | ) const |
---|
2037 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g, h); } |
---|
2038 | |
---|
2039 | mem_func_ptr_t fptr; |
---|
2040 | }; |
---|
2041 | |
---|
2042 | ////////////////////////////////// |
---|
2043 | template <typename RT, typename ClassT, |
---|
2044 | typename A, typename B, typename C, typename D, |
---|
2045 | typename E, typename F, typename G, typename H |
---|
2046 | > |
---|
2047 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H> |
---|
2048 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) |
---|
2049 | { |
---|
2050 | return member_function_ptr< |
---|
2051 | RT, ClassT, A, B, C, D, E, F, G, H>(fptr); |
---|
2052 | } |
---|
2053 | |
---|
2054 | ////////////////////////////////// |
---|
2055 | template <typename RT, typename ClassT, |
---|
2056 | typename A, typename B, typename C, typename D, |
---|
2057 | typename E, typename F, typename G, typename H |
---|
2058 | > |
---|
2059 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H> |
---|
2060 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) |
---|
2061 | { |
---|
2062 | return member_function_ptr< |
---|
2063 | RT, ClassT const, A, B, C, D, E, F, G, H>(fptr); |
---|
2064 | } |
---|
2065 | |
---|
2066 | #if PHOENIX_LIMIT > 9 |
---|
2067 | /////////////////////////////////////////////////////////////////////////////// |
---|
2068 | // |
---|
2069 | // Member function pointer binder (specialization for 9 args) |
---|
2070 | // |
---|
2071 | /////////////////////////////////////////////////////////////////////////////// |
---|
2072 | template <typename RT, typename ClassT, |
---|
2073 | typename A, typename B, typename C, typename D, |
---|
2074 | typename E, typename F, typename G, typename H, typename I |
---|
2075 | > |
---|
2076 | struct member_function_ptr_action<RT, ClassT, |
---|
2077 | A, B, C, D, E, F, G, H, I, nil_t, nil_t, nil_t, |
---|
2078 | #if PHOENIX_LIMIT > 12 |
---|
2079 | nil_t, nil_t, nil_t, |
---|
2080 | #endif |
---|
2081 | nil_t // Unused |
---|
2082 | > { |
---|
2083 | |
---|
2084 | typedef RT result_type; |
---|
2085 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I); |
---|
2086 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I) const; |
---|
2087 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2088 | mem_func_ptr_t; |
---|
2089 | |
---|
2090 | template <typename CT, |
---|
2091 | typename A_, typename B_, typename C_, typename D_, |
---|
2092 | typename E_, typename F_, typename G_, typename H_, typename I_ |
---|
2093 | > |
---|
2094 | struct result { typedef result_type type; }; |
---|
2095 | |
---|
2096 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2097 | : fptr(fptr_) {} |
---|
2098 | |
---|
2099 | template <typename CT> |
---|
2100 | result_type operator()(CT& obj, |
---|
2101 | A a, B b, C c, D d, E e, F f, G g, H h, I i |
---|
2102 | ) const |
---|
2103 | { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g, h, i); } |
---|
2104 | |
---|
2105 | mem_func_ptr_t fptr; |
---|
2106 | }; |
---|
2107 | |
---|
2108 | ////////////////////////////////// |
---|
2109 | template <typename RT, typename ClassT, |
---|
2110 | typename A, typename B, typename C, typename D, |
---|
2111 | typename E, typename F, typename G, typename H, typename I |
---|
2112 | > |
---|
2113 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I> |
---|
2114 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) |
---|
2115 | { |
---|
2116 | return member_function_ptr< |
---|
2117 | RT, ClassT, A, B, C, D, E, F, G, H, I>(fptr); |
---|
2118 | } |
---|
2119 | |
---|
2120 | ////////////////////////////////// |
---|
2121 | template <typename RT, typename ClassT, |
---|
2122 | typename A, typename B, typename C, typename D, |
---|
2123 | typename E, typename F, typename G, typename H, typename I |
---|
2124 | > |
---|
2125 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I> |
---|
2126 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) |
---|
2127 | { |
---|
2128 | return member_function_ptr< |
---|
2129 | RT, ClassT const, A, B, C, D, E, F, G, H, I>(fptr); |
---|
2130 | } |
---|
2131 | |
---|
2132 | /////////////////////////////////////////////////////////////////////////////// |
---|
2133 | // |
---|
2134 | // Member function pointer binder (specialization for 10 args) |
---|
2135 | // |
---|
2136 | /////////////////////////////////////////////////////////////////////////////// |
---|
2137 | template <typename RT, typename ClassT, |
---|
2138 | typename A, typename B, typename C, typename D, |
---|
2139 | typename E, typename F, typename G, typename H, typename I, |
---|
2140 | typename J |
---|
2141 | > |
---|
2142 | struct member_function_ptr_action<RT, ClassT, |
---|
2143 | A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, |
---|
2144 | #if PHOENIX_LIMIT > 12 |
---|
2145 | nil_t, nil_t, nil_t, |
---|
2146 | #endif |
---|
2147 | nil_t // Unused |
---|
2148 | > { |
---|
2149 | |
---|
2150 | typedef RT result_type; |
---|
2151 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J); |
---|
2152 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J) const; |
---|
2153 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2154 | mem_func_ptr_t; |
---|
2155 | |
---|
2156 | template <typename CT, |
---|
2157 | typename A_, typename B_, typename C_, typename D_, |
---|
2158 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2159 | typename J_ |
---|
2160 | > |
---|
2161 | struct result { typedef result_type type; }; |
---|
2162 | |
---|
2163 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2164 | : fptr(fptr_) {} |
---|
2165 | |
---|
2166 | template <typename CT> |
---|
2167 | result_type operator()(CT& obj, |
---|
2168 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j |
---|
2169 | ) const |
---|
2170 | { |
---|
2171 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2172 | (a, b, c, d, e, f, g, h, i, j); |
---|
2173 | } |
---|
2174 | |
---|
2175 | mem_func_ptr_t fptr; |
---|
2176 | }; |
---|
2177 | |
---|
2178 | ////////////////////////////////// |
---|
2179 | template <typename RT, typename ClassT, |
---|
2180 | typename A, typename B, typename C, typename D, |
---|
2181 | typename E, typename F, typename G, typename H, typename I, |
---|
2182 | typename J |
---|
2183 | > |
---|
2184 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J> |
---|
2185 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) |
---|
2186 | { |
---|
2187 | return member_function_ptr< |
---|
2188 | RT, ClassT, A, B, C, D, E, F, G, H, I, J>(fptr); |
---|
2189 | } |
---|
2190 | |
---|
2191 | ////////////////////////////////// |
---|
2192 | template <typename RT, typename ClassT, |
---|
2193 | typename A, typename B, typename C, typename D, |
---|
2194 | typename E, typename F, typename G, typename H, typename I, |
---|
2195 | typename J |
---|
2196 | > |
---|
2197 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> |
---|
2198 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) |
---|
2199 | { |
---|
2200 | return member_function_ptr< |
---|
2201 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(fptr); |
---|
2202 | } |
---|
2203 | |
---|
2204 | /////////////////////////////////////////////////////////////////////////////// |
---|
2205 | // |
---|
2206 | // Member function pointer binder (specialization for 11 args) |
---|
2207 | // |
---|
2208 | /////////////////////////////////////////////////////////////////////////////// |
---|
2209 | template <typename RT, typename ClassT, |
---|
2210 | typename A, typename B, typename C, typename D, |
---|
2211 | typename E, typename F, typename G, typename H, typename I, |
---|
2212 | typename J, typename K |
---|
2213 | > |
---|
2214 | struct member_function_ptr_action<RT, ClassT, |
---|
2215 | A, B, C, D, E, F, G, H, I, J, K, nil_t, |
---|
2216 | #if PHOENIX_LIMIT > 12 |
---|
2217 | nil_t, nil_t, nil_t, |
---|
2218 | #endif |
---|
2219 | nil_t // Unused |
---|
2220 | > { |
---|
2221 | |
---|
2222 | typedef RT result_type; |
---|
2223 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K); |
---|
2224 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K) const; |
---|
2225 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2226 | mem_func_ptr_t; |
---|
2227 | |
---|
2228 | template <typename CT, |
---|
2229 | typename A_, typename B_, typename C_, typename D_, |
---|
2230 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2231 | typename J_, typename K_ |
---|
2232 | > |
---|
2233 | struct result { typedef result_type type; }; |
---|
2234 | |
---|
2235 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2236 | : fptr(fptr_) {} |
---|
2237 | |
---|
2238 | template <typename CT> |
---|
2239 | result_type operator()(CT& obj, |
---|
2240 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k |
---|
2241 | ) const |
---|
2242 | { |
---|
2243 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2244 | (a, b, c, d, e, f, g, h, i, j, k); |
---|
2245 | } |
---|
2246 | |
---|
2247 | mem_func_ptr_t fptr; |
---|
2248 | }; |
---|
2249 | |
---|
2250 | ////////////////////////////////// |
---|
2251 | template <typename RT, typename ClassT, |
---|
2252 | typename A, typename B, typename C, typename D, |
---|
2253 | typename E, typename F, typename G, typename H, typename I, |
---|
2254 | typename J, typename K |
---|
2255 | > |
---|
2256 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> |
---|
2257 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) |
---|
2258 | { |
---|
2259 | return member_function_ptr< |
---|
2260 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(fptr); |
---|
2261 | } |
---|
2262 | |
---|
2263 | ////////////////////////////////// |
---|
2264 | template <typename RT, typename ClassT, |
---|
2265 | typename A, typename B, typename C, typename D, |
---|
2266 | typename E, typename F, typename G, typename H, typename I, |
---|
2267 | typename J, typename K |
---|
2268 | > |
---|
2269 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> |
---|
2270 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) |
---|
2271 | { |
---|
2272 | return member_function_ptr< |
---|
2273 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(fptr); |
---|
2274 | } |
---|
2275 | |
---|
2276 | #if PHOENIX_LIMIT > 12 |
---|
2277 | /////////////////////////////////////////////////////////////////////////////// |
---|
2278 | // |
---|
2279 | // Member function pointer binder (specialization for 12 args) |
---|
2280 | // |
---|
2281 | /////////////////////////////////////////////////////////////////////////////// |
---|
2282 | template <typename RT, typename ClassT, |
---|
2283 | typename A, typename B, typename C, typename D, |
---|
2284 | typename E, typename F, typename G, typename H, typename I, |
---|
2285 | typename J, typename K, typename L |
---|
2286 | > |
---|
2287 | struct member_function_ptr_action<RT, ClassT, |
---|
2288 | A, B, C, D, E, F, G, H, I, J, K, L, nil_t, nil_t, nil_t, nil_t> { |
---|
2289 | |
---|
2290 | typedef RT result_type; |
---|
2291 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L); |
---|
2292 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L) const; |
---|
2293 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2294 | mem_func_ptr_t; |
---|
2295 | |
---|
2296 | template <typename CT, |
---|
2297 | typename A_, typename B_, typename C_, typename D_, |
---|
2298 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2299 | typename J_, typename K_, typename L_ |
---|
2300 | > |
---|
2301 | struct result { typedef result_type type; }; |
---|
2302 | |
---|
2303 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2304 | : fptr(fptr_) {} |
---|
2305 | |
---|
2306 | template <typename CT> |
---|
2307 | result_type operator()(CT& obj, |
---|
2308 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l |
---|
2309 | ) const |
---|
2310 | { |
---|
2311 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2312 | (a, b, c, d, e, f, g, h, i, j, k, l); |
---|
2313 | } |
---|
2314 | |
---|
2315 | mem_func_ptr_t fptr; |
---|
2316 | }; |
---|
2317 | |
---|
2318 | ////////////////////////////////// |
---|
2319 | template <typename RT, typename ClassT, |
---|
2320 | typename A, typename B, typename C, typename D, |
---|
2321 | typename E, typename F, typename G, typename H, typename I, |
---|
2322 | typename J, typename K, typename L |
---|
2323 | > |
---|
2324 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
2325 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) |
---|
2326 | { |
---|
2327 | return member_function_ptr< |
---|
2328 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); |
---|
2329 | } |
---|
2330 | |
---|
2331 | ////////////////////////////////// |
---|
2332 | template <typename RT, typename ClassT, |
---|
2333 | typename A, typename B, typename C, typename D, |
---|
2334 | typename E, typename F, typename G, typename H, typename I, |
---|
2335 | typename J, typename K, typename L |
---|
2336 | > |
---|
2337 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
2338 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) |
---|
2339 | { |
---|
2340 | return member_function_ptr< |
---|
2341 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); |
---|
2342 | } |
---|
2343 | |
---|
2344 | /////////////////////////////////////////////////////////////////////////////// |
---|
2345 | // |
---|
2346 | // Member function pointer binder (specialization for 13 args) |
---|
2347 | // |
---|
2348 | /////////////////////////////////////////////////////////////////////////////// |
---|
2349 | template <typename RT, typename ClassT, |
---|
2350 | typename A, typename B, typename C, typename D, |
---|
2351 | typename E, typename F, typename G, typename H, typename I, |
---|
2352 | typename J, typename K, typename L, typename M |
---|
2353 | > |
---|
2354 | struct member_function_ptr_action<RT, ClassT, |
---|
2355 | A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { |
---|
2356 | |
---|
2357 | typedef RT result_type; |
---|
2358 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M); |
---|
2359 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M) const; |
---|
2360 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2361 | mem_func_ptr_t; |
---|
2362 | |
---|
2363 | template <typename CT, |
---|
2364 | typename A_, typename B_, typename C_, typename D_, |
---|
2365 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2366 | typename J_, typename K_, typename L_, typename M_ |
---|
2367 | > |
---|
2368 | struct result { typedef result_type type; }; |
---|
2369 | |
---|
2370 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2371 | : fptr(fptr_) {} |
---|
2372 | |
---|
2373 | template <typename CT> |
---|
2374 | result_type operator()(CT& obj, |
---|
2375 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m |
---|
2376 | ) const |
---|
2377 | { |
---|
2378 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2379 | (a, b, c, d, e, f, g, h, i, j, k, l, m); |
---|
2380 | } |
---|
2381 | |
---|
2382 | mem_func_ptr_t fptr; |
---|
2383 | }; |
---|
2384 | |
---|
2385 | ////////////////////////////////// |
---|
2386 | template <typename RT, typename ClassT, |
---|
2387 | typename A, typename B, typename C, typename D, |
---|
2388 | typename E, typename F, typename G, typename H, typename I, |
---|
2389 | typename J, typename K, typename L, typename M |
---|
2390 | > |
---|
2391 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
2392 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) |
---|
2393 | { |
---|
2394 | return member_function_ptr< |
---|
2395 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); |
---|
2396 | } |
---|
2397 | |
---|
2398 | ////////////////////////////////// |
---|
2399 | template <typename RT, typename ClassT, |
---|
2400 | typename A, typename B, typename C, typename D, |
---|
2401 | typename E, typename F, typename G, typename H, typename I, |
---|
2402 | typename J, typename K, typename L, typename M |
---|
2403 | > |
---|
2404 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
2405 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) |
---|
2406 | { |
---|
2407 | return member_function_ptr< |
---|
2408 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); |
---|
2409 | } |
---|
2410 | |
---|
2411 | /////////////////////////////////////////////////////////////////////////////// |
---|
2412 | // |
---|
2413 | // Member function pointer binder (specialization for 14 args) |
---|
2414 | // |
---|
2415 | /////////////////////////////////////////////////////////////////////////////// |
---|
2416 | template <typename RT, typename ClassT, |
---|
2417 | typename A, typename B, typename C, typename D, |
---|
2418 | typename E, typename F, typename G, typename H, typename I, |
---|
2419 | typename J, typename K, typename L, typename M, typename N |
---|
2420 | > |
---|
2421 | struct member_function_ptr_action<RT, ClassT, |
---|
2422 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { |
---|
2423 | |
---|
2424 | typedef RT result_type; |
---|
2425 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); |
---|
2426 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const; |
---|
2427 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2428 | mem_func_ptr_t; |
---|
2429 | |
---|
2430 | template <typename CT, |
---|
2431 | typename A_, typename B_, typename C_, typename D_, |
---|
2432 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2433 | typename J_, typename K_, typename L_, typename M_, typename N_ |
---|
2434 | > |
---|
2435 | struct result { typedef result_type type; }; |
---|
2436 | |
---|
2437 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2438 | : fptr(fptr_) {} |
---|
2439 | |
---|
2440 | template <typename CT> |
---|
2441 | result_type operator()(CT& obj, |
---|
2442 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n |
---|
2443 | ) const |
---|
2444 | { |
---|
2445 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2446 | (a, b, c, d, e, f, g, h, i, j, k, l, m, n); |
---|
2447 | } |
---|
2448 | |
---|
2449 | mem_func_ptr_t fptr; |
---|
2450 | }; |
---|
2451 | |
---|
2452 | ////////////////////////////////// |
---|
2453 | template <typename RT, typename ClassT, |
---|
2454 | typename A, typename B, typename C, typename D, |
---|
2455 | typename E, typename F, typename G, typename H, typename I, |
---|
2456 | typename J, typename K, typename L, typename M, typename N |
---|
2457 | > |
---|
2458 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
2459 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) |
---|
2460 | { |
---|
2461 | return member_function_ptr< |
---|
2462 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); |
---|
2463 | } |
---|
2464 | |
---|
2465 | ////////////////////////////////// |
---|
2466 | template <typename RT, typename ClassT, |
---|
2467 | typename A, typename B, typename C, typename D, |
---|
2468 | typename E, typename F, typename G, typename H, typename I, |
---|
2469 | typename J, typename K, typename L, typename M, typename N |
---|
2470 | > |
---|
2471 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
2472 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) |
---|
2473 | { |
---|
2474 | return member_function_ptr< |
---|
2475 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); |
---|
2476 | } |
---|
2477 | |
---|
2478 | /////////////////////////////////////////////////////////////////////////////// |
---|
2479 | // |
---|
2480 | // Member function pointer binder (specialization for 15 args) |
---|
2481 | // |
---|
2482 | /////////////////////////////////////////////////////////////////////////////// |
---|
2483 | template <typename RT, typename ClassT, |
---|
2484 | typename A, typename B, typename C, typename D, |
---|
2485 | typename E, typename F, typename G, typename H, typename I, |
---|
2486 | typename J, typename K, typename L, typename M, typename N, |
---|
2487 | typename O |
---|
2488 | > |
---|
2489 | struct member_function_ptr_action<RT, ClassT, |
---|
2490 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { |
---|
2491 | |
---|
2492 | typedef RT result_type; |
---|
2493 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); |
---|
2494 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const; |
---|
2495 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2496 | mem_func_ptr_t; |
---|
2497 | |
---|
2498 | template <typename CT, |
---|
2499 | typename A_, typename B_, typename C_, typename D_, |
---|
2500 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
2501 | typename J_, typename K_, typename L_, typename M_, typename N_, |
---|
2502 | typename O_ |
---|
2503 | > |
---|
2504 | struct result { typedef result_type type; }; |
---|
2505 | |
---|
2506 | member_function_ptr_action(mem_func_ptr_t fptr_) |
---|
2507 | : fptr(fptr_) {} |
---|
2508 | |
---|
2509 | template <typename CT> |
---|
2510 | result_type operator()(CT& obj, |
---|
2511 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o |
---|
2512 | ) const |
---|
2513 | { |
---|
2514 | return (impl::as_ptr<CT>::get(obj)->*fptr) |
---|
2515 | (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); |
---|
2516 | } |
---|
2517 | |
---|
2518 | mem_func_ptr_t fptr; |
---|
2519 | }; |
---|
2520 | |
---|
2521 | ////////////////////////////////// |
---|
2522 | template <typename RT, typename ClassT, |
---|
2523 | typename A, typename B, typename C, typename D, |
---|
2524 | typename E, typename F, typename G, typename H, typename I, |
---|
2525 | typename J, typename K, typename L, typename M, typename N, |
---|
2526 | typename O |
---|
2527 | > |
---|
2528 | inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
2529 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) |
---|
2530 | { |
---|
2531 | return member_function_ptr< |
---|
2532 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); |
---|
2533 | } |
---|
2534 | |
---|
2535 | ////////////////////////////////// |
---|
2536 | template <typename RT, typename ClassT, |
---|
2537 | typename A, typename B, typename C, typename D, |
---|
2538 | typename E, typename F, typename G, typename H, typename I, |
---|
2539 | typename J, typename K, typename L, typename M, typename N, |
---|
2540 | typename O |
---|
2541 | > |
---|
2542 | inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
2543 | bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) |
---|
2544 | { |
---|
2545 | return member_function_ptr< |
---|
2546 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); |
---|
2547 | } |
---|
2548 | |
---|
2549 | #endif |
---|
2550 | #endif |
---|
2551 | #endif |
---|
2552 | #endif |
---|
2553 | |
---|
2554 | /////////////////////////////////////////////////////////////////////////////// |
---|
2555 | // |
---|
2556 | // Bound member function binder (main class) |
---|
2557 | // |
---|
2558 | /////////////////////////////////////////////////////////////////////////////// |
---|
2559 | template < |
---|
2560 | typename RT, |
---|
2561 | typename ClassT |
---|
2562 | , typename A = nil_t |
---|
2563 | , typename B = nil_t |
---|
2564 | , typename C = nil_t |
---|
2565 | |
---|
2566 | #if PHOENIX_LIMIT > 3 |
---|
2567 | , typename D = nil_t |
---|
2568 | , typename E = nil_t |
---|
2569 | , typename F = nil_t |
---|
2570 | |
---|
2571 | #if PHOENIX_LIMIT > 6 |
---|
2572 | , typename G = nil_t |
---|
2573 | , typename H = nil_t |
---|
2574 | , typename I = nil_t |
---|
2575 | |
---|
2576 | #if PHOENIX_LIMIT > 9 |
---|
2577 | , typename J = nil_t |
---|
2578 | , typename K = nil_t |
---|
2579 | , typename L = nil_t |
---|
2580 | |
---|
2581 | #if PHOENIX_LIMIT > 12 |
---|
2582 | , typename M = nil_t |
---|
2583 | , typename N = nil_t |
---|
2584 | , typename O = nil_t |
---|
2585 | |
---|
2586 | #endif |
---|
2587 | #endif |
---|
2588 | #endif |
---|
2589 | #endif |
---|
2590 | |
---|
2591 | , typename NU = nil_t // Not used |
---|
2592 | > |
---|
2593 | struct bound_member_action; |
---|
2594 | |
---|
2595 | ////////////////////////////////// |
---|
2596 | template < |
---|
2597 | typename RT, |
---|
2598 | typename ClassT |
---|
2599 | , typename A = nil_t |
---|
2600 | , typename B = nil_t |
---|
2601 | , typename C = nil_t |
---|
2602 | |
---|
2603 | #if PHOENIX_LIMIT > 3 |
---|
2604 | , typename D = nil_t |
---|
2605 | , typename E = nil_t |
---|
2606 | , typename F = nil_t |
---|
2607 | |
---|
2608 | #if PHOENIX_LIMIT > 6 |
---|
2609 | , typename G = nil_t |
---|
2610 | , typename H = nil_t |
---|
2611 | , typename I = nil_t |
---|
2612 | |
---|
2613 | #if PHOENIX_LIMIT > 9 |
---|
2614 | , typename J = nil_t |
---|
2615 | , typename K = nil_t |
---|
2616 | , typename L = nil_t |
---|
2617 | |
---|
2618 | #if PHOENIX_LIMIT > 12 |
---|
2619 | , typename M = nil_t |
---|
2620 | , typename N = nil_t |
---|
2621 | , typename O = nil_t |
---|
2622 | |
---|
2623 | #endif |
---|
2624 | #endif |
---|
2625 | #endif |
---|
2626 | #endif |
---|
2627 | > |
---|
2628 | struct bound_member |
---|
2629 | : public function<bound_member_action<RT, ClassT |
---|
2630 | , A, B, C |
---|
2631 | #if PHOENIX_LIMIT > 3 |
---|
2632 | , D, E, F |
---|
2633 | #if PHOENIX_LIMIT > 6 |
---|
2634 | , G, H, I |
---|
2635 | #if PHOENIX_LIMIT > 9 |
---|
2636 | , J, K, L |
---|
2637 | #if PHOENIX_LIMIT > 12 |
---|
2638 | , M, N, O |
---|
2639 | #endif |
---|
2640 | #endif |
---|
2641 | #endif |
---|
2642 | #endif |
---|
2643 | > > { |
---|
2644 | |
---|
2645 | typedef bound_member_action<RT, ClassT |
---|
2646 | , A, B, C |
---|
2647 | #if PHOENIX_LIMIT > 3 |
---|
2648 | , D, E, F |
---|
2649 | #if PHOENIX_LIMIT > 6 |
---|
2650 | , G, H, I |
---|
2651 | #if PHOENIX_LIMIT > 9 |
---|
2652 | , J, K, L |
---|
2653 | #if PHOENIX_LIMIT > 12 |
---|
2654 | , M, N, O |
---|
2655 | #endif |
---|
2656 | #endif |
---|
2657 | #endif |
---|
2658 | #endif |
---|
2659 | > action_t; |
---|
2660 | |
---|
2661 | template <typename CT, typename FPT> |
---|
2662 | bound_member(CT & c, FPT fp) |
---|
2663 | : function<action_t>(action_t(c,fp)) {} |
---|
2664 | |
---|
2665 | #if !defined(__BORLANDC__) |
---|
2666 | template <typename CT, typename FPT> |
---|
2667 | bound_member(CT * c, FPT fp) |
---|
2668 | : function<action_t>(action_t(c,fp)) {} |
---|
2669 | #endif |
---|
2670 | }; |
---|
2671 | |
---|
2672 | /////////////////////////////////////////////////////////////////////////////// |
---|
2673 | // |
---|
2674 | // Bound member function binder (specialization for 0 arg) |
---|
2675 | // |
---|
2676 | /////////////////////////////////////////////////////////////////////////////// |
---|
2677 | |
---|
2678 | template <typename RT, typename ClassT> |
---|
2679 | struct bound_member_action<RT, ClassT, |
---|
2680 | nil_t, nil_t, nil_t, |
---|
2681 | #if PHOENIX_LIMIT > 3 |
---|
2682 | nil_t, nil_t, nil_t, |
---|
2683 | #if PHOENIX_LIMIT > 6 |
---|
2684 | nil_t, nil_t, nil_t, |
---|
2685 | #if PHOENIX_LIMIT > 9 |
---|
2686 | nil_t, nil_t, nil_t, |
---|
2687 | #if PHOENIX_LIMIT > 12 |
---|
2688 | nil_t, nil_t, nil_t, |
---|
2689 | #endif |
---|
2690 | #endif |
---|
2691 | #endif |
---|
2692 | #endif |
---|
2693 | nil_t // Unused |
---|
2694 | > { |
---|
2695 | |
---|
2696 | typedef RT result_type; |
---|
2697 | typedef RT(ClassT::*mf)(); |
---|
2698 | typedef RT(ClassT::*cmf)() const; |
---|
2699 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2700 | mem_func_ptr_t; |
---|
2701 | |
---|
2702 | template <typename CT> |
---|
2703 | struct result { typedef result_type type; }; |
---|
2704 | |
---|
2705 | template <typename CT> |
---|
2706 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
2707 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
2708 | |
---|
2709 | result_type operator()() const |
---|
2710 | { return (obj->*fptr)(); } |
---|
2711 | |
---|
2712 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
2713 | mem_func_ptr_t fptr; |
---|
2714 | }; |
---|
2715 | |
---|
2716 | ////////////////////////////////// |
---|
2717 | |
---|
2718 | template <typename RT, typename ClassT> |
---|
2719 | inline bound_member<RT,ClassT> |
---|
2720 | bind(ClassT & obj, RT(ClassT::*fptr)()) |
---|
2721 | { |
---|
2722 | return bound_member<RT,ClassT>(obj, fptr); |
---|
2723 | } |
---|
2724 | |
---|
2725 | template <typename RT, typename ClassT> |
---|
2726 | inline bound_member<RT,ClassT> |
---|
2727 | bind(ClassT * obj, RT(ClassT::*fptr)()) |
---|
2728 | { |
---|
2729 | #if defined(__MWERKS__) && (__MWERKS__ < 0x3003) |
---|
2730 | return bound_member<RT,ClassT>(*obj, fptr); |
---|
2731 | #else |
---|
2732 | return bound_member<RT,ClassT>(obj, fptr); |
---|
2733 | #endif |
---|
2734 | } |
---|
2735 | |
---|
2736 | template <typename RT, typename ClassT> |
---|
2737 | inline bound_member<RT,ClassT const> |
---|
2738 | bind(ClassT const& obj, RT(ClassT::*fptr)()) |
---|
2739 | { |
---|
2740 | return bound_member<RT,ClassT const>(obj, fptr); |
---|
2741 | } |
---|
2742 | |
---|
2743 | template <typename RT, typename ClassT> |
---|
2744 | inline bound_member<RT,ClassT const> |
---|
2745 | bind(ClassT const* obj, RT(ClassT::*fptr)() const) |
---|
2746 | { |
---|
2747 | #if defined(__MWERKS__) && (__MWERKS__ < 0x3003) |
---|
2748 | return bound_member<RT,ClassT const>(*obj, fptr); |
---|
2749 | #else |
---|
2750 | return bound_member<RT,ClassT const>(obj, fptr); |
---|
2751 | #endif |
---|
2752 | } |
---|
2753 | |
---|
2754 | /////////////////////////////////////////////////////////////////////////////// |
---|
2755 | // |
---|
2756 | // Bound member function binder (specialization for 1 arg) |
---|
2757 | // |
---|
2758 | /////////////////////////////////////////////////////////////////////////////// |
---|
2759 | template <typename RT, typename ClassT, typename A> |
---|
2760 | struct bound_member_action<RT, ClassT, |
---|
2761 | A, nil_t, nil_t, |
---|
2762 | #if PHOENIX_LIMIT > 3 |
---|
2763 | nil_t, nil_t, nil_t, |
---|
2764 | #if PHOENIX_LIMIT > 6 |
---|
2765 | nil_t, nil_t, nil_t, |
---|
2766 | #if PHOENIX_LIMIT > 9 |
---|
2767 | nil_t, nil_t, nil_t, |
---|
2768 | #if PHOENIX_LIMIT > 12 |
---|
2769 | nil_t, nil_t, nil_t, |
---|
2770 | #endif |
---|
2771 | #endif |
---|
2772 | #endif |
---|
2773 | #endif |
---|
2774 | nil_t // Unused |
---|
2775 | > { |
---|
2776 | |
---|
2777 | typedef RT result_type; |
---|
2778 | typedef RT(ClassT::*mf)(A); |
---|
2779 | typedef RT(ClassT::*cmf)(A) const; |
---|
2780 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2781 | mem_func_ptr_t; |
---|
2782 | |
---|
2783 | template <typename A_> |
---|
2784 | struct result { typedef result_type type; }; |
---|
2785 | |
---|
2786 | template <typename CT> |
---|
2787 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
2788 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
2789 | |
---|
2790 | result_type operator()(A a) const |
---|
2791 | { return (obj->*fptr)(a); } |
---|
2792 | |
---|
2793 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
2794 | mem_func_ptr_t fptr; |
---|
2795 | }; |
---|
2796 | |
---|
2797 | ////////////////////////////////// |
---|
2798 | template <typename RT, typename ClassT, typename A> |
---|
2799 | inline bound_member<RT, ClassT, A> |
---|
2800 | bind(ClassT & obj, RT(ClassT::*fptr)(A)) |
---|
2801 | { |
---|
2802 | return bound_member<RT, ClassT, A>(obj,fptr); |
---|
2803 | } |
---|
2804 | |
---|
2805 | template <typename RT, typename ClassT, typename A> |
---|
2806 | inline bound_member<RT, ClassT, A> |
---|
2807 | bind(ClassT * obj, RT(ClassT::*fptr)(A)) |
---|
2808 | { |
---|
2809 | return bound_member<RT, ClassT, A>(obj,fptr); |
---|
2810 | } |
---|
2811 | |
---|
2812 | ////////////////////////////////// |
---|
2813 | template <typename RT, typename ClassT, typename A> |
---|
2814 | inline bound_member<RT, ClassT const, A> |
---|
2815 | bind(ClassT const& obj, RT(ClassT::*fptr)(A) const) |
---|
2816 | { |
---|
2817 | return bound_member<RT, ClassT const, A>(obj,fptr); |
---|
2818 | } |
---|
2819 | |
---|
2820 | template <typename RT, typename ClassT, typename A> |
---|
2821 | inline bound_member<RT, ClassT const, A> |
---|
2822 | bind(ClassT const* obj, RT(ClassT::*fptr)(A) const) |
---|
2823 | { |
---|
2824 | return bound_member<RT, ClassT const, A>(obj,fptr); |
---|
2825 | } |
---|
2826 | |
---|
2827 | /////////////////////////////////////////////////////////////////////////////// |
---|
2828 | // |
---|
2829 | // Bound member function binder (specialization for 2 args) |
---|
2830 | // |
---|
2831 | /////////////////////////////////////////////////////////////////////////////// |
---|
2832 | template <typename RT, typename ClassT, typename A, typename B> |
---|
2833 | struct bound_member_action<RT, ClassT, |
---|
2834 | A, B, nil_t, |
---|
2835 | #if PHOENIX_LIMIT > 3 |
---|
2836 | nil_t, nil_t, nil_t, |
---|
2837 | #if PHOENIX_LIMIT > 6 |
---|
2838 | nil_t, nil_t, nil_t, |
---|
2839 | #if PHOENIX_LIMIT > 9 |
---|
2840 | nil_t, nil_t, nil_t, |
---|
2841 | #if PHOENIX_LIMIT > 12 |
---|
2842 | nil_t, nil_t, nil_t, |
---|
2843 | #endif |
---|
2844 | #endif |
---|
2845 | #endif |
---|
2846 | #endif |
---|
2847 | nil_t // Unused |
---|
2848 | > { |
---|
2849 | |
---|
2850 | typedef RT result_type; |
---|
2851 | typedef RT(ClassT::*mf)(A, B); |
---|
2852 | typedef RT(ClassT::*cmf)(A, B) const; |
---|
2853 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2854 | mem_func_ptr_t; |
---|
2855 | |
---|
2856 | template <typename A_, typename B_> |
---|
2857 | struct result { typedef result_type type; }; |
---|
2858 | |
---|
2859 | template <typename CT> |
---|
2860 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
2861 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
2862 | |
---|
2863 | result_type operator()(A a, B b) const |
---|
2864 | { return (obj->*fptr)(a, b); } |
---|
2865 | |
---|
2866 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
2867 | mem_func_ptr_t fptr; |
---|
2868 | }; |
---|
2869 | |
---|
2870 | ////////////////////////////////// |
---|
2871 | template <typename RT, typename ClassT, typename A, typename B> |
---|
2872 | inline bound_member<RT, ClassT, A, B> |
---|
2873 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B)) |
---|
2874 | { |
---|
2875 | return bound_member<RT, ClassT, A, B>(obj,fptr); |
---|
2876 | } |
---|
2877 | |
---|
2878 | template <typename RT, typename ClassT, typename A, typename B> |
---|
2879 | inline bound_member<RT, ClassT, A, B> |
---|
2880 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B)) |
---|
2881 | { |
---|
2882 | return bound_member<RT, ClassT, A, B>(obj,fptr); |
---|
2883 | } |
---|
2884 | |
---|
2885 | template <typename RT, typename ClassT, typename A, typename B> |
---|
2886 | inline bound_member<RT, ClassT const, A, B> |
---|
2887 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B) const) |
---|
2888 | { |
---|
2889 | return bound_member<RT, ClassT const, A, B>(obj,fptr); |
---|
2890 | } |
---|
2891 | |
---|
2892 | template <typename RT, typename ClassT, typename A, typename B> |
---|
2893 | inline bound_member<RT, ClassT const, A, B> |
---|
2894 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B) const) |
---|
2895 | { |
---|
2896 | return bound_member<RT, ClassT const, A, B>(obj,fptr); |
---|
2897 | } |
---|
2898 | |
---|
2899 | #if PHOENIX_LIMIT > 3 |
---|
2900 | /////////////////////////////////////////////////////////////////////////////// |
---|
2901 | // |
---|
2902 | // Bound member function binder (specialization for 3 args) |
---|
2903 | // |
---|
2904 | /////////////////////////////////////////////////////////////////////////////// |
---|
2905 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
2906 | struct bound_member_action<RT, ClassT, |
---|
2907 | A, B, C, nil_t, nil_t, nil_t, |
---|
2908 | #if PHOENIX_LIMIT > 6 |
---|
2909 | nil_t, nil_t, nil_t, |
---|
2910 | #if PHOENIX_LIMIT > 9 |
---|
2911 | nil_t, nil_t, nil_t, |
---|
2912 | #if PHOENIX_LIMIT > 12 |
---|
2913 | nil_t, nil_t, nil_t, |
---|
2914 | #endif |
---|
2915 | #endif |
---|
2916 | #endif |
---|
2917 | nil_t // Unused |
---|
2918 | > { |
---|
2919 | |
---|
2920 | typedef RT result_type; |
---|
2921 | typedef RT(ClassT::*mf)(A, B, C); |
---|
2922 | typedef RT(ClassT::*cmf)(A, B, C) const; |
---|
2923 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2924 | mem_func_ptr_t; |
---|
2925 | |
---|
2926 | template <typename A_, typename B_, typename C_> |
---|
2927 | struct result { typedef result_type type; }; |
---|
2928 | |
---|
2929 | template <typename CT> |
---|
2930 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
2931 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
2932 | |
---|
2933 | result_type operator()(A a, B b, C c) const |
---|
2934 | { return (obj->*fptr)(a, b, c); } |
---|
2935 | |
---|
2936 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
2937 | mem_func_ptr_t fptr; |
---|
2938 | }; |
---|
2939 | |
---|
2940 | ////////////////////////////////// |
---|
2941 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
2942 | inline bound_member<RT, ClassT, A, B, C> |
---|
2943 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C)) |
---|
2944 | { |
---|
2945 | return bound_member<RT, ClassT, A, B, C>(obj,fptr); |
---|
2946 | } |
---|
2947 | |
---|
2948 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
2949 | inline bound_member<RT, ClassT, A, B, C> |
---|
2950 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C)) |
---|
2951 | { |
---|
2952 | return bound_member<RT, ClassT, A, B, C>(obj,fptr); |
---|
2953 | } |
---|
2954 | |
---|
2955 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
2956 | inline bound_member<RT, ClassT const, A, B, C> |
---|
2957 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C) const) |
---|
2958 | { |
---|
2959 | return bound_member<RT, ClassT const, A, B, C>(obj,fptr); |
---|
2960 | } |
---|
2961 | |
---|
2962 | template <typename RT, typename ClassT, typename A, typename B, typename C> |
---|
2963 | inline bound_member<RT, ClassT const, A, B, C> |
---|
2964 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C) const) |
---|
2965 | { |
---|
2966 | return bound_member<RT, ClassT const, A, B, C>(obj,fptr); |
---|
2967 | } |
---|
2968 | |
---|
2969 | /////////////////////////////////////////////////////////////////////////////// |
---|
2970 | // |
---|
2971 | // Bound member function binder (specialization for 4 args) |
---|
2972 | // |
---|
2973 | /////////////////////////////////////////////////////////////////////////////// |
---|
2974 | template <typename RT, typename ClassT, |
---|
2975 | typename A, typename B, typename C, typename D |
---|
2976 | > |
---|
2977 | struct bound_member_action<RT, ClassT, |
---|
2978 | A, B, C, D, nil_t, nil_t, |
---|
2979 | #if PHOENIX_LIMIT > 6 |
---|
2980 | nil_t, nil_t, nil_t, |
---|
2981 | #if PHOENIX_LIMIT > 9 |
---|
2982 | nil_t, nil_t, nil_t, |
---|
2983 | #if PHOENIX_LIMIT > 12 |
---|
2984 | nil_t, nil_t, nil_t, |
---|
2985 | #endif |
---|
2986 | #endif |
---|
2987 | #endif |
---|
2988 | nil_t // Unused |
---|
2989 | > { |
---|
2990 | |
---|
2991 | typedef RT result_type; |
---|
2992 | typedef RT(ClassT::*mf)(A, B, C, D); |
---|
2993 | typedef RT(ClassT::*cmf)(A, B, C, D) const; |
---|
2994 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
2995 | mem_func_ptr_t; |
---|
2996 | |
---|
2997 | template <typename A_, typename B_, typename C_, typename D_> |
---|
2998 | struct result { typedef result_type type; }; |
---|
2999 | |
---|
3000 | template <typename CT> |
---|
3001 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3002 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3003 | |
---|
3004 | result_type operator()(A a, B b, C c, D d) const |
---|
3005 | { return (obj->*fptr)(a, b, c, d); } |
---|
3006 | |
---|
3007 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3008 | mem_func_ptr_t fptr; |
---|
3009 | }; |
---|
3010 | |
---|
3011 | ////////////////////////////////// |
---|
3012 | template <typename RT, typename ClassT, |
---|
3013 | typename A, typename B, typename C, typename D |
---|
3014 | > |
---|
3015 | inline bound_member<RT, ClassT, A, B, C, D> |
---|
3016 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D)) |
---|
3017 | { |
---|
3018 | return bound_member< |
---|
3019 | RT, ClassT, A, B, C, D>(obj,fptr); |
---|
3020 | } |
---|
3021 | |
---|
3022 | template <typename RT, typename ClassT, |
---|
3023 | typename A, typename B, typename C, typename D |
---|
3024 | > |
---|
3025 | inline bound_member<RT, ClassT, A, B, C, D> |
---|
3026 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D)) |
---|
3027 | { |
---|
3028 | return bound_member< |
---|
3029 | RT, ClassT, A, B, C, D>(obj,fptr); |
---|
3030 | } |
---|
3031 | |
---|
3032 | template <typename RT, typename ClassT, |
---|
3033 | typename A, typename B, typename C, typename D |
---|
3034 | > |
---|
3035 | inline bound_member<RT, ClassT const, A, B, C, D> |
---|
3036 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D) const) |
---|
3037 | { |
---|
3038 | return bound_member< |
---|
3039 | RT, ClassT const, A, B, C, D>(obj,fptr); |
---|
3040 | } |
---|
3041 | |
---|
3042 | template <typename RT, typename ClassT, |
---|
3043 | typename A, typename B, typename C, typename D |
---|
3044 | > |
---|
3045 | inline bound_member<RT, ClassT const, A, B, C, D> |
---|
3046 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D) const) |
---|
3047 | { |
---|
3048 | return bound_member< |
---|
3049 | RT, ClassT const, A, B, C, D>(obj,fptr); |
---|
3050 | } |
---|
3051 | |
---|
3052 | /////////////////////////////////////////////////////////////////////////////// |
---|
3053 | // |
---|
3054 | // Bound member function binder (specialization for 5 args) |
---|
3055 | // |
---|
3056 | /////////////////////////////////////////////////////////////////////////////// |
---|
3057 | template <typename RT, typename ClassT, |
---|
3058 | typename A, typename B, typename C, typename D, |
---|
3059 | typename E |
---|
3060 | > |
---|
3061 | struct bound_member_action<RT, ClassT, |
---|
3062 | A, B, C, D, E, nil_t, |
---|
3063 | #if PHOENIX_LIMIT > 6 |
---|
3064 | nil_t, nil_t, nil_t, |
---|
3065 | #if PHOENIX_LIMIT > 9 |
---|
3066 | nil_t, nil_t, nil_t, |
---|
3067 | #if PHOENIX_LIMIT > 12 |
---|
3068 | nil_t, nil_t, nil_t, |
---|
3069 | #endif |
---|
3070 | #endif |
---|
3071 | #endif |
---|
3072 | nil_t // Unused |
---|
3073 | > { |
---|
3074 | |
---|
3075 | typedef RT result_type; |
---|
3076 | typedef RT(ClassT::*mf)(A, B, C, D, E); |
---|
3077 | typedef RT(ClassT::*cmf)(A, B, C, D, E) const; |
---|
3078 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3079 | mem_func_ptr_t; |
---|
3080 | |
---|
3081 | template <typename A_, typename B_, typename C_, typename D_, |
---|
3082 | typename E_ |
---|
3083 | > |
---|
3084 | struct result { typedef result_type type; }; |
---|
3085 | |
---|
3086 | template <typename CT> |
---|
3087 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3088 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3089 | |
---|
3090 | result_type operator()( |
---|
3091 | A a, B b, C c, D d, E e |
---|
3092 | ) const |
---|
3093 | { return (obj->*fptr)(a, b, c, d, e); } |
---|
3094 | |
---|
3095 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3096 | mem_func_ptr_t fptr; |
---|
3097 | }; |
---|
3098 | |
---|
3099 | ////////////////////////////////// |
---|
3100 | template <typename RT, typename ClassT, |
---|
3101 | typename A, typename B, typename C, typename D, |
---|
3102 | typename E |
---|
3103 | > |
---|
3104 | inline bound_member<RT, ClassT, A, B, C, D, E> |
---|
3105 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E)) |
---|
3106 | { |
---|
3107 | return bound_member< |
---|
3108 | RT, ClassT, A, B, C, D, E>(obj,fptr); |
---|
3109 | } |
---|
3110 | |
---|
3111 | template <typename RT, typename ClassT, |
---|
3112 | typename A, typename B, typename C, typename D, |
---|
3113 | typename E |
---|
3114 | > |
---|
3115 | inline bound_member<RT, ClassT, A, B, C, D, E> |
---|
3116 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E)) |
---|
3117 | { |
---|
3118 | return bound_member< |
---|
3119 | RT, ClassT, A, B, C, D, E>(obj,fptr); |
---|
3120 | } |
---|
3121 | |
---|
3122 | template <typename RT, typename ClassT, |
---|
3123 | typename A, typename B, typename C, typename D, |
---|
3124 | typename E |
---|
3125 | > |
---|
3126 | inline bound_member<RT, ClassT const, A, B, C, D, E> |
---|
3127 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E) const) |
---|
3128 | { |
---|
3129 | return bound_member< |
---|
3130 | RT, ClassT const, A, B, C, D, E>(obj,fptr); |
---|
3131 | } |
---|
3132 | |
---|
3133 | template <typename RT, typename ClassT, |
---|
3134 | typename A, typename B, typename C, typename D, |
---|
3135 | typename E |
---|
3136 | > |
---|
3137 | inline bound_member<RT, ClassT const, A, B, C, D, E> |
---|
3138 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E) const) |
---|
3139 | { |
---|
3140 | return bound_member< |
---|
3141 | RT, ClassT const, A, B, C, D, E>(obj,fptr); |
---|
3142 | } |
---|
3143 | |
---|
3144 | #if PHOENIX_LIMIT > 6 |
---|
3145 | /////////////////////////////////////////////////////////////////////////////// |
---|
3146 | // |
---|
3147 | // Bound member function binder (specialization for 6 args) |
---|
3148 | // |
---|
3149 | /////////////////////////////////////////////////////////////////////////////// |
---|
3150 | template <typename RT, typename ClassT, |
---|
3151 | typename A, typename B, typename C, typename D, |
---|
3152 | typename E, typename F |
---|
3153 | > |
---|
3154 | struct bound_member_action<RT, ClassT, |
---|
3155 | A, B, C, D, E, F, nil_t, nil_t, nil_t, |
---|
3156 | #if PHOENIX_LIMIT > 9 |
---|
3157 | nil_t, nil_t, nil_t, |
---|
3158 | #if PHOENIX_LIMIT > 12 |
---|
3159 | nil_t, nil_t, nil_t, |
---|
3160 | #endif |
---|
3161 | #endif |
---|
3162 | nil_t // Unused |
---|
3163 | > { |
---|
3164 | |
---|
3165 | typedef RT result_type; |
---|
3166 | typedef RT(ClassT::*mf)(A, B, C, D, E, F); |
---|
3167 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F) const; |
---|
3168 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3169 | mem_func_ptr_t; |
---|
3170 | |
---|
3171 | template < |
---|
3172 | typename A_, typename B_, typename C_, typename D_, |
---|
3173 | typename E_, typename F_ |
---|
3174 | > |
---|
3175 | struct result { typedef result_type type; }; |
---|
3176 | |
---|
3177 | template <typename CT> |
---|
3178 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3179 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3180 | |
---|
3181 | result_type operator()( |
---|
3182 | A a, B b, C c, D d, E e, F f |
---|
3183 | ) const |
---|
3184 | { return (obj->*fptr)(a, b, c, d, e, f); } |
---|
3185 | |
---|
3186 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3187 | mem_func_ptr_t fptr; |
---|
3188 | }; |
---|
3189 | |
---|
3190 | ////////////////////////////////// |
---|
3191 | template <typename RT, typename ClassT, |
---|
3192 | typename A, typename B, typename C, typename D, |
---|
3193 | typename E, typename F |
---|
3194 | > |
---|
3195 | inline bound_member<RT, ClassT, A, B, C, D, E, F> |
---|
3196 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F)) |
---|
3197 | { |
---|
3198 | return bound_member< |
---|
3199 | RT, ClassT, A, B, C, D, E, F>(obj,fptr); |
---|
3200 | } |
---|
3201 | |
---|
3202 | template <typename RT, typename ClassT, |
---|
3203 | typename A, typename B, typename C, typename D, |
---|
3204 | typename E, typename F |
---|
3205 | > |
---|
3206 | inline bound_member<RT, ClassT, A, B, C, D, E, F> |
---|
3207 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F)) |
---|
3208 | { |
---|
3209 | return bound_member< |
---|
3210 | RT, ClassT, A, B, C, D, E, F>(obj,fptr); |
---|
3211 | } |
---|
3212 | |
---|
3213 | template <typename RT, typename ClassT, |
---|
3214 | typename A, typename B, typename C, typename D, |
---|
3215 | typename E, typename F |
---|
3216 | > |
---|
3217 | inline bound_member<RT, ClassT const, A, B, C, D, E, F> |
---|
3218 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F) const) |
---|
3219 | { |
---|
3220 | return bound_member< |
---|
3221 | RT, ClassT const, A, B, C, D, E, F>(obj,fptr); |
---|
3222 | } |
---|
3223 | |
---|
3224 | template <typename RT, typename ClassT, |
---|
3225 | typename A, typename B, typename C, typename D, |
---|
3226 | typename E, typename F |
---|
3227 | > |
---|
3228 | inline bound_member<RT, ClassT const, A, B, C, D, E, F> |
---|
3229 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F) const) |
---|
3230 | { |
---|
3231 | return bound_member< |
---|
3232 | RT, ClassT const, A, B, C, D, E, F>(obj,fptr); |
---|
3233 | } |
---|
3234 | |
---|
3235 | /////////////////////////////////////////////////////////////////////////////// |
---|
3236 | // |
---|
3237 | // Bound member function binder (specialization for 7 args) |
---|
3238 | // |
---|
3239 | /////////////////////////////////////////////////////////////////////////////// |
---|
3240 | template <typename RT, typename ClassT, |
---|
3241 | typename A, typename B, typename C, typename D, |
---|
3242 | typename E, typename F, typename G |
---|
3243 | > |
---|
3244 | struct bound_member_action<RT, ClassT, |
---|
3245 | A, B, C, D, E, F, G, nil_t, nil_t, |
---|
3246 | #if PHOENIX_LIMIT > 9 |
---|
3247 | nil_t, nil_t, nil_t, |
---|
3248 | #if PHOENIX_LIMIT > 12 |
---|
3249 | nil_t, nil_t, nil_t, |
---|
3250 | #endif |
---|
3251 | #endif |
---|
3252 | nil_t // Unused |
---|
3253 | > { |
---|
3254 | |
---|
3255 | typedef RT result_type; |
---|
3256 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G); |
---|
3257 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G) const; |
---|
3258 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3259 | mem_func_ptr_t; |
---|
3260 | |
---|
3261 | template < |
---|
3262 | typename A_, typename B_, typename C_, typename D_, |
---|
3263 | typename E_, typename F_, typename G_ |
---|
3264 | > |
---|
3265 | struct result { typedef result_type type; }; |
---|
3266 | |
---|
3267 | template <typename CT> |
---|
3268 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3269 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3270 | |
---|
3271 | result_type operator()( |
---|
3272 | A a, B b, C c, D d, E e, F f, G g |
---|
3273 | ) const |
---|
3274 | { return (obj->*fptr)(a, b, c, d, e, f, g); } |
---|
3275 | |
---|
3276 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3277 | mem_func_ptr_t fptr; |
---|
3278 | }; |
---|
3279 | |
---|
3280 | ////////////////////////////////// |
---|
3281 | template <typename RT, typename ClassT, |
---|
3282 | typename A, typename B, typename C, typename D, |
---|
3283 | typename E, typename F, typename G |
---|
3284 | > |
---|
3285 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G> |
---|
3286 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G)) |
---|
3287 | { |
---|
3288 | return bound_member< |
---|
3289 | RT, ClassT, A, B, C, D, E, F, G>(obj,fptr); |
---|
3290 | } |
---|
3291 | |
---|
3292 | template <typename RT, typename ClassT, |
---|
3293 | typename A, typename B, typename C, typename D, |
---|
3294 | typename E, typename F, typename G |
---|
3295 | > |
---|
3296 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G> |
---|
3297 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G)) |
---|
3298 | { |
---|
3299 | return bound_member< |
---|
3300 | RT, ClassT, A, B, C, D, E, F, G>(obj,fptr); |
---|
3301 | } |
---|
3302 | |
---|
3303 | template <typename RT, typename ClassT, |
---|
3304 | typename A, typename B, typename C, typename D, |
---|
3305 | typename E, typename F, typename G |
---|
3306 | > |
---|
3307 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G> |
---|
3308 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) |
---|
3309 | { |
---|
3310 | return bound_member< |
---|
3311 | RT, ClassT const, A, B, C, D, E, F, G>(obj,fptr); |
---|
3312 | } |
---|
3313 | |
---|
3314 | template <typename RT, typename ClassT, |
---|
3315 | typename A, typename B, typename C, typename D, |
---|
3316 | typename E, typename F, typename G |
---|
3317 | > |
---|
3318 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G> |
---|
3319 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) |
---|
3320 | { |
---|
3321 | return bound_member< |
---|
3322 | RT, ClassT const, A, B, C, D, E, F, G>(obj,fptr); |
---|
3323 | } |
---|
3324 | |
---|
3325 | /////////////////////////////////////////////////////////////////////////////// |
---|
3326 | // |
---|
3327 | // Bound member function binder (specialization for 8 args) |
---|
3328 | // |
---|
3329 | /////////////////////////////////////////////////////////////////////////////// |
---|
3330 | template <typename RT, typename ClassT, |
---|
3331 | typename A, typename B, typename C, typename D, |
---|
3332 | typename E, typename F, typename G, typename H |
---|
3333 | > |
---|
3334 | struct bound_member_action<RT, ClassT, |
---|
3335 | A, B, C, D, E, F, G, H, nil_t, |
---|
3336 | #if PHOENIX_LIMIT > 9 |
---|
3337 | nil_t, nil_t, nil_t, |
---|
3338 | #if PHOENIX_LIMIT > 12 |
---|
3339 | nil_t, nil_t, nil_t, |
---|
3340 | #endif |
---|
3341 | #endif |
---|
3342 | nil_t // Unused |
---|
3343 | > { |
---|
3344 | |
---|
3345 | typedef RT result_type; |
---|
3346 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H); |
---|
3347 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H) const; |
---|
3348 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3349 | mem_func_ptr_t; |
---|
3350 | |
---|
3351 | template < |
---|
3352 | typename A_, typename B_, typename C_, typename D_, |
---|
3353 | typename E_, typename F_, typename G_, typename H_ |
---|
3354 | > |
---|
3355 | struct result { typedef result_type type; }; |
---|
3356 | |
---|
3357 | template <typename CT> |
---|
3358 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3359 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3360 | |
---|
3361 | result_type operator()( |
---|
3362 | A a, B b, C c, D d, E e, F f, G g, H h |
---|
3363 | ) const |
---|
3364 | { return (obj->*fptr)(a, b, c, d, e, f, g, h); } |
---|
3365 | |
---|
3366 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3367 | mem_func_ptr_t fptr; |
---|
3368 | }; |
---|
3369 | |
---|
3370 | ////////////////////////////////// |
---|
3371 | template <typename RT, typename ClassT, |
---|
3372 | typename A, typename B, typename C, typename D, |
---|
3373 | typename E, typename F, typename G, typename H |
---|
3374 | > |
---|
3375 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H> |
---|
3376 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) |
---|
3377 | { |
---|
3378 | return bound_member< |
---|
3379 | RT, ClassT, A, B, C, D, E, F, G, H>(obj,fptr); |
---|
3380 | } |
---|
3381 | |
---|
3382 | template <typename RT, typename ClassT, |
---|
3383 | typename A, typename B, typename C, typename D, |
---|
3384 | typename E, typename F, typename G, typename H |
---|
3385 | > |
---|
3386 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H> |
---|
3387 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) |
---|
3388 | { |
---|
3389 | return bound_member< |
---|
3390 | RT, ClassT, A, B, C, D, E, F, G, H>(obj,fptr); |
---|
3391 | } |
---|
3392 | |
---|
3393 | template <typename RT, typename ClassT, |
---|
3394 | typename A, typename B, typename C, typename D, |
---|
3395 | typename E, typename F, typename G, typename H |
---|
3396 | > |
---|
3397 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H> |
---|
3398 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) |
---|
3399 | { |
---|
3400 | return bound_member< |
---|
3401 | RT, ClassT const, A, B, C, D, E, F, G, H>(obj,fptr); |
---|
3402 | } |
---|
3403 | |
---|
3404 | template <typename RT, typename ClassT, |
---|
3405 | typename A, typename B, typename C, typename D, |
---|
3406 | typename E, typename F, typename G, typename H |
---|
3407 | > |
---|
3408 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H> |
---|
3409 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) |
---|
3410 | { |
---|
3411 | return bound_member< |
---|
3412 | RT, ClassT const, A, B, C, D, E, F, G, H>(obj,fptr); |
---|
3413 | } |
---|
3414 | |
---|
3415 | #if PHOENIX_LIMIT > 9 |
---|
3416 | /////////////////////////////////////////////////////////////////////////////// |
---|
3417 | // |
---|
3418 | // Bound member function binder (specialization for 9 args) |
---|
3419 | // |
---|
3420 | /////////////////////////////////////////////////////////////////////////////// |
---|
3421 | template <typename RT, typename ClassT, |
---|
3422 | typename A, typename B, typename C, typename D, |
---|
3423 | typename E, typename F, typename G, typename H, typename I |
---|
3424 | > |
---|
3425 | struct bound_member_action<RT, ClassT, |
---|
3426 | A, B, C, D, E, F, G, H, I, nil_t, nil_t, nil_t, |
---|
3427 | #if PHOENIX_LIMIT > 12 |
---|
3428 | nil_t, nil_t, nil_t, |
---|
3429 | #endif |
---|
3430 | nil_t // Unused |
---|
3431 | > { |
---|
3432 | |
---|
3433 | typedef RT result_type; |
---|
3434 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I); |
---|
3435 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I) const; |
---|
3436 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3437 | mem_func_ptr_t; |
---|
3438 | |
---|
3439 | template < |
---|
3440 | typename A_, typename B_, typename C_, typename D_, |
---|
3441 | typename E_, typename F_, typename G_, typename H_, typename I_ |
---|
3442 | > |
---|
3443 | struct result { typedef result_type type; }; |
---|
3444 | |
---|
3445 | template <typename CT> |
---|
3446 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3447 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3448 | |
---|
3449 | result_type operator()( |
---|
3450 | A a, B b, C c, D d, E e, F f, G g, H h, I i |
---|
3451 | ) const |
---|
3452 | { return (obj->*fptr)(a, b, c, d, e, f, g, h, i); } |
---|
3453 | |
---|
3454 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3455 | mem_func_ptr_t fptr; |
---|
3456 | }; |
---|
3457 | |
---|
3458 | ////////////////////////////////// |
---|
3459 | template <typename RT, typename ClassT, |
---|
3460 | typename A, typename B, typename C, typename D, |
---|
3461 | typename E, typename F, typename G, typename H, typename I |
---|
3462 | > |
---|
3463 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I> |
---|
3464 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) |
---|
3465 | { |
---|
3466 | return bound_member< |
---|
3467 | RT, ClassT, A, B, C, D, E, F, G, H, I>(obj,fptr); |
---|
3468 | } |
---|
3469 | |
---|
3470 | template <typename RT, typename ClassT, |
---|
3471 | typename A, typename B, typename C, typename D, |
---|
3472 | typename E, typename F, typename G, typename H, typename I |
---|
3473 | > |
---|
3474 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I> |
---|
3475 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) |
---|
3476 | { |
---|
3477 | return bound_member< |
---|
3478 | RT, ClassT, A, B, C, D, E, F, G, H, I>(obj,fptr); |
---|
3479 | } |
---|
3480 | |
---|
3481 | template <typename RT, typename ClassT, |
---|
3482 | typename A, typename B, typename C, typename D, |
---|
3483 | typename E, typename F, typename G, typename H, typename I |
---|
3484 | > |
---|
3485 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I> |
---|
3486 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) |
---|
3487 | { |
---|
3488 | return bound_member< |
---|
3489 | RT, ClassT const, A, B, C, D, E, F, G, H, I>(obj,fptr); |
---|
3490 | } |
---|
3491 | |
---|
3492 | template <typename RT, typename ClassT, |
---|
3493 | typename A, typename B, typename C, typename D, |
---|
3494 | typename E, typename F, typename G, typename H, typename I |
---|
3495 | > |
---|
3496 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I> |
---|
3497 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) |
---|
3498 | { |
---|
3499 | return bound_member< |
---|
3500 | RT, ClassT const, A, B, C, D, E, F, G, H, I>(obj,fptr); |
---|
3501 | } |
---|
3502 | |
---|
3503 | /////////////////////////////////////////////////////////////////////////////// |
---|
3504 | // |
---|
3505 | // Bound member function binder (specialization for 10 args) |
---|
3506 | // |
---|
3507 | /////////////////////////////////////////////////////////////////////////////// |
---|
3508 | template <typename RT, typename ClassT, |
---|
3509 | typename A, typename B, typename C, typename D, |
---|
3510 | typename E, typename F, typename G, typename H, typename I, |
---|
3511 | typename J |
---|
3512 | > |
---|
3513 | struct bound_member_action<RT, ClassT, |
---|
3514 | A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, |
---|
3515 | #if PHOENIX_LIMIT > 12 |
---|
3516 | nil_t, nil_t, nil_t, |
---|
3517 | #endif |
---|
3518 | nil_t // Unused |
---|
3519 | > { |
---|
3520 | |
---|
3521 | typedef RT result_type; |
---|
3522 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J); |
---|
3523 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J) const; |
---|
3524 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3525 | mem_func_ptr_t; |
---|
3526 | |
---|
3527 | template < |
---|
3528 | typename A_, typename B_, typename C_, typename D_, |
---|
3529 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3530 | typename J_ |
---|
3531 | > |
---|
3532 | struct result { typedef result_type type; }; |
---|
3533 | |
---|
3534 | template <typename CT> |
---|
3535 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3536 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3537 | |
---|
3538 | result_type operator()( |
---|
3539 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j |
---|
3540 | ) const |
---|
3541 | { |
---|
3542 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j); |
---|
3543 | } |
---|
3544 | |
---|
3545 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3546 | mem_func_ptr_t fptr; |
---|
3547 | }; |
---|
3548 | |
---|
3549 | ////////////////////////////////// |
---|
3550 | template <typename RT, typename ClassT, |
---|
3551 | typename A, typename B, typename C, typename D, |
---|
3552 | typename E, typename F, typename G, typename H, typename I, |
---|
3553 | typename J |
---|
3554 | > |
---|
3555 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J> |
---|
3556 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) |
---|
3557 | { |
---|
3558 | return bound_member< |
---|
3559 | RT, ClassT, A, B, C, D, E, F, G, H, I, J>(obj,fptr); |
---|
3560 | } |
---|
3561 | |
---|
3562 | template <typename RT, typename ClassT, |
---|
3563 | typename A, typename B, typename C, typename D, |
---|
3564 | typename E, typename F, typename G, typename H, typename I, |
---|
3565 | typename J |
---|
3566 | > |
---|
3567 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J> |
---|
3568 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) |
---|
3569 | { |
---|
3570 | return bound_member< |
---|
3571 | RT, ClassT, A, B, C, D, E, F, G, H, I, J>(obj,fptr); |
---|
3572 | } |
---|
3573 | |
---|
3574 | template <typename RT, typename ClassT, |
---|
3575 | typename A, typename B, typename C, typename D, |
---|
3576 | typename E, typename F, typename G, typename H, typename I, |
---|
3577 | typename J |
---|
3578 | > |
---|
3579 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> |
---|
3580 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) |
---|
3581 | { |
---|
3582 | return bound_member< |
---|
3583 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(obj,fptr); |
---|
3584 | } |
---|
3585 | |
---|
3586 | template <typename RT, typename ClassT, |
---|
3587 | typename A, typename B, typename C, typename D, |
---|
3588 | typename E, typename F, typename G, typename H, typename I, |
---|
3589 | typename J |
---|
3590 | > |
---|
3591 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> |
---|
3592 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) |
---|
3593 | { |
---|
3594 | return bound_member< |
---|
3595 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(obj,fptr); |
---|
3596 | } |
---|
3597 | |
---|
3598 | /////////////////////////////////////////////////////////////////////////////// |
---|
3599 | // |
---|
3600 | // Bound member function binder (specialization for 11 args) |
---|
3601 | // |
---|
3602 | /////////////////////////////////////////////////////////////////////////////// |
---|
3603 | template <typename RT, typename ClassT, |
---|
3604 | typename A, typename B, typename C, typename D, |
---|
3605 | typename E, typename F, typename G, typename H, typename I, |
---|
3606 | typename J, typename K |
---|
3607 | > |
---|
3608 | struct bound_member_action<RT, ClassT, |
---|
3609 | A, B, C, D, E, F, G, H, I, J, K, nil_t, |
---|
3610 | #if PHOENIX_LIMIT > 12 |
---|
3611 | nil_t, nil_t, nil_t, |
---|
3612 | #endif |
---|
3613 | nil_t // Unused |
---|
3614 | > { |
---|
3615 | |
---|
3616 | typedef RT result_type; |
---|
3617 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K); |
---|
3618 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K) const; |
---|
3619 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3620 | mem_func_ptr_t; |
---|
3621 | |
---|
3622 | template < |
---|
3623 | typename A_, typename B_, typename C_, typename D_, |
---|
3624 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3625 | typename J_, typename K_ |
---|
3626 | > |
---|
3627 | struct result { typedef result_type type; }; |
---|
3628 | |
---|
3629 | template <typename CT> |
---|
3630 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3631 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3632 | |
---|
3633 | result_type operator()( |
---|
3634 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k |
---|
3635 | ) const |
---|
3636 | { |
---|
3637 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k); |
---|
3638 | } |
---|
3639 | |
---|
3640 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3641 | mem_func_ptr_t fptr; |
---|
3642 | }; |
---|
3643 | |
---|
3644 | ////////////////////////////////// |
---|
3645 | template <typename RT, typename ClassT, |
---|
3646 | typename A, typename B, typename C, typename D, |
---|
3647 | typename E, typename F, typename G, typename H, typename I, |
---|
3648 | typename J, typename K |
---|
3649 | > |
---|
3650 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> |
---|
3651 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) |
---|
3652 | { |
---|
3653 | return bound_member< |
---|
3654 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); |
---|
3655 | } |
---|
3656 | |
---|
3657 | template <typename RT, typename ClassT, |
---|
3658 | typename A, typename B, typename C, typename D, |
---|
3659 | typename E, typename F, typename G, typename H, typename I, |
---|
3660 | typename J, typename K |
---|
3661 | > |
---|
3662 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> |
---|
3663 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) |
---|
3664 | { |
---|
3665 | return bound_member< |
---|
3666 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); |
---|
3667 | } |
---|
3668 | |
---|
3669 | template <typename RT, typename ClassT, |
---|
3670 | typename A, typename B, typename C, typename D, |
---|
3671 | typename E, typename F, typename G, typename H, typename I, |
---|
3672 | typename J, typename K |
---|
3673 | > |
---|
3674 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> |
---|
3675 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) |
---|
3676 | { |
---|
3677 | return bound_member< |
---|
3678 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); |
---|
3679 | } |
---|
3680 | |
---|
3681 | template <typename RT, typename ClassT, |
---|
3682 | typename A, typename B, typename C, typename D, |
---|
3683 | typename E, typename F, typename G, typename H, typename I, |
---|
3684 | typename J, typename K |
---|
3685 | > |
---|
3686 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> |
---|
3687 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) |
---|
3688 | { |
---|
3689 | return bound_member< |
---|
3690 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); |
---|
3691 | } |
---|
3692 | |
---|
3693 | #if PHOENIX_LIMIT > 12 |
---|
3694 | /////////////////////////////////////////////////////////////////////////////// |
---|
3695 | // |
---|
3696 | // Bound member function binder (specialization for 12 args) |
---|
3697 | // |
---|
3698 | /////////////////////////////////////////////////////////////////////////////// |
---|
3699 | template <typename RT, typename ClassT, |
---|
3700 | typename A, typename B, typename C, typename D, |
---|
3701 | typename E, typename F, typename G, typename H, typename I, |
---|
3702 | typename J, typename K, typename L |
---|
3703 | > |
---|
3704 | struct bound_member_action<RT, ClassT, |
---|
3705 | A, B, C, D, E, F, G, H, I, J, K, L, nil_t, nil_t, nil_t, nil_t> { |
---|
3706 | |
---|
3707 | typedef RT result_type; |
---|
3708 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L); |
---|
3709 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L) const; |
---|
3710 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3711 | mem_func_ptr_t; |
---|
3712 | |
---|
3713 | template < |
---|
3714 | typename A_, typename B_, typename C_, typename D_, |
---|
3715 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3716 | typename J_, typename K_, typename L_ |
---|
3717 | > |
---|
3718 | struct result { typedef result_type type; }; |
---|
3719 | |
---|
3720 | template <typename CT> |
---|
3721 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3722 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3723 | |
---|
3724 | result_type operator()( |
---|
3725 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l |
---|
3726 | ) const |
---|
3727 | { |
---|
3728 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l); |
---|
3729 | } |
---|
3730 | |
---|
3731 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3732 | mem_func_ptr_t fptr; |
---|
3733 | }; |
---|
3734 | |
---|
3735 | ////////////////////////////////// |
---|
3736 | template <typename RT, typename ClassT, |
---|
3737 | typename A, typename B, typename C, typename D, |
---|
3738 | typename E, typename F, typename G, typename H, typename I, |
---|
3739 | typename J, typename K, typename L |
---|
3740 | > |
---|
3741 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
3742 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) |
---|
3743 | { |
---|
3744 | return bound_member< |
---|
3745 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); |
---|
3746 | } |
---|
3747 | |
---|
3748 | template <typename RT, typename ClassT, |
---|
3749 | typename A, typename B, typename C, typename D, |
---|
3750 | typename E, typename F, typename G, typename H, typename I, |
---|
3751 | typename J, typename K, typename L |
---|
3752 | > |
---|
3753 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
3754 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) |
---|
3755 | { |
---|
3756 | return bound_member< |
---|
3757 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); |
---|
3758 | } |
---|
3759 | |
---|
3760 | template <typename RT, typename ClassT, |
---|
3761 | typename A, typename B, typename C, typename D, |
---|
3762 | typename E, typename F, typename G, typename H, typename I, |
---|
3763 | typename J, typename K, typename L |
---|
3764 | > |
---|
3765 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
3766 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) |
---|
3767 | { |
---|
3768 | return bound_member< |
---|
3769 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); |
---|
3770 | } |
---|
3771 | |
---|
3772 | template <typename RT, typename ClassT, |
---|
3773 | typename A, typename B, typename C, typename D, |
---|
3774 | typename E, typename F, typename G, typename H, typename I, |
---|
3775 | typename J, typename K, typename L |
---|
3776 | > |
---|
3777 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> |
---|
3778 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) |
---|
3779 | { |
---|
3780 | return bound_member< |
---|
3781 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); |
---|
3782 | } |
---|
3783 | |
---|
3784 | /////////////////////////////////////////////////////////////////////////////// |
---|
3785 | // |
---|
3786 | // Bound member function binder (specialization for 13 args) |
---|
3787 | // |
---|
3788 | /////////////////////////////////////////////////////////////////////////////// |
---|
3789 | template <typename RT, typename ClassT, |
---|
3790 | typename A, typename B, typename C, typename D, |
---|
3791 | typename E, typename F, typename G, typename H, typename I, |
---|
3792 | typename J, typename K, typename L, typename M |
---|
3793 | > |
---|
3794 | struct bound_member_action<RT, ClassT, |
---|
3795 | A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { |
---|
3796 | |
---|
3797 | typedef RT result_type; |
---|
3798 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M); |
---|
3799 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M) const; |
---|
3800 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3801 | mem_func_ptr_t; |
---|
3802 | |
---|
3803 | template < |
---|
3804 | typename A_, typename B_, typename C_, typename D_, |
---|
3805 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3806 | typename J_, typename K_, typename L_, typename M_ |
---|
3807 | > |
---|
3808 | struct result { typedef result_type type; }; |
---|
3809 | |
---|
3810 | template <typename CT> |
---|
3811 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3812 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3813 | |
---|
3814 | result_type operator()( |
---|
3815 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m |
---|
3816 | ) const |
---|
3817 | { |
---|
3818 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m); |
---|
3819 | } |
---|
3820 | |
---|
3821 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3822 | mem_func_ptr_t fptr; |
---|
3823 | }; |
---|
3824 | |
---|
3825 | ////////////////////////////////// |
---|
3826 | template <typename RT, typename ClassT, |
---|
3827 | typename A, typename B, typename C, typename D, |
---|
3828 | typename E, typename F, typename G, typename H, typename I, |
---|
3829 | typename J, typename K, typename L, typename M |
---|
3830 | > |
---|
3831 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
3832 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) |
---|
3833 | { |
---|
3834 | return bound_member< |
---|
3835 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); |
---|
3836 | } |
---|
3837 | |
---|
3838 | template <typename RT, typename ClassT, |
---|
3839 | typename A, typename B, typename C, typename D, |
---|
3840 | typename E, typename F, typename G, typename H, typename I, |
---|
3841 | typename J, typename K, typename L, typename M |
---|
3842 | > |
---|
3843 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
3844 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) |
---|
3845 | { |
---|
3846 | return bound_member< |
---|
3847 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); |
---|
3848 | } |
---|
3849 | |
---|
3850 | template <typename RT, typename ClassT, |
---|
3851 | typename A, typename B, typename C, typename D, |
---|
3852 | typename E, typename F, typename G, typename H, typename I, |
---|
3853 | typename J, typename K, typename L, typename M |
---|
3854 | > |
---|
3855 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
3856 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) |
---|
3857 | { |
---|
3858 | return bound_member< |
---|
3859 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); |
---|
3860 | } |
---|
3861 | |
---|
3862 | template <typename RT, typename ClassT, |
---|
3863 | typename A, typename B, typename C, typename D, |
---|
3864 | typename E, typename F, typename G, typename H, typename I, |
---|
3865 | typename J, typename K, typename L, typename M |
---|
3866 | > |
---|
3867 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> |
---|
3868 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) |
---|
3869 | { |
---|
3870 | return bound_member< |
---|
3871 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); |
---|
3872 | } |
---|
3873 | |
---|
3874 | /////////////////////////////////////////////////////////////////////////////// |
---|
3875 | // |
---|
3876 | // Bound member function binder (specialization for 14 args) |
---|
3877 | // |
---|
3878 | /////////////////////////////////////////////////////////////////////////////// |
---|
3879 | template <typename RT, typename ClassT, |
---|
3880 | typename A, typename B, typename C, typename D, |
---|
3881 | typename E, typename F, typename G, typename H, typename I, |
---|
3882 | typename J, typename K, typename L, typename M, typename N |
---|
3883 | > |
---|
3884 | struct bound_member_action<RT, ClassT, |
---|
3885 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { |
---|
3886 | |
---|
3887 | typedef RT result_type; |
---|
3888 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); |
---|
3889 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const; |
---|
3890 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3891 | mem_func_ptr_t; |
---|
3892 | |
---|
3893 | template < |
---|
3894 | typename A_, typename B_, typename C_, typename D_, |
---|
3895 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3896 | typename J_, typename K_, typename L_, typename M_, typename N_ |
---|
3897 | > |
---|
3898 | struct result { typedef result_type type; }; |
---|
3899 | |
---|
3900 | template <typename CT> |
---|
3901 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3902 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3903 | |
---|
3904 | result_type operator()( |
---|
3905 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n |
---|
3906 | ) const |
---|
3907 | { |
---|
3908 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m, n); |
---|
3909 | } |
---|
3910 | |
---|
3911 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
3912 | mem_func_ptr_t fptr; |
---|
3913 | }; |
---|
3914 | |
---|
3915 | ////////////////////////////////// |
---|
3916 | template <typename RT, typename ClassT, |
---|
3917 | typename A, typename B, typename C, typename D, |
---|
3918 | typename E, typename F, typename G, typename H, typename I, |
---|
3919 | typename J, typename K, typename L, typename M, typename N |
---|
3920 | > |
---|
3921 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
3922 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) |
---|
3923 | { |
---|
3924 | return bound_member< |
---|
3925 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); |
---|
3926 | } |
---|
3927 | |
---|
3928 | template <typename RT, typename ClassT, |
---|
3929 | typename A, typename B, typename C, typename D, |
---|
3930 | typename E, typename F, typename G, typename H, typename I, |
---|
3931 | typename J, typename K, typename L, typename M, typename N |
---|
3932 | > |
---|
3933 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
3934 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) |
---|
3935 | { |
---|
3936 | return bound_member< |
---|
3937 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); |
---|
3938 | } |
---|
3939 | |
---|
3940 | template <typename RT, typename ClassT, |
---|
3941 | typename A, typename B, typename C, typename D, |
---|
3942 | typename E, typename F, typename G, typename H, typename I, |
---|
3943 | typename J, typename K, typename L, typename M, typename N |
---|
3944 | > |
---|
3945 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
3946 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) |
---|
3947 | { |
---|
3948 | return bound_member< |
---|
3949 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); |
---|
3950 | } |
---|
3951 | |
---|
3952 | template <typename RT, typename ClassT, |
---|
3953 | typename A, typename B, typename C, typename D, |
---|
3954 | typename E, typename F, typename G, typename H, typename I, |
---|
3955 | typename J, typename K, typename L, typename M, typename N |
---|
3956 | > |
---|
3957 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> |
---|
3958 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) |
---|
3959 | { |
---|
3960 | return bound_member< |
---|
3961 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); |
---|
3962 | } |
---|
3963 | |
---|
3964 | /////////////////////////////////////////////////////////////////////////////// |
---|
3965 | // |
---|
3966 | // Bound member function binder (specialization for 15 args) |
---|
3967 | // |
---|
3968 | /////////////////////////////////////////////////////////////////////////////// |
---|
3969 | template <typename RT, typename ClassT, |
---|
3970 | typename A, typename B, typename C, typename D, |
---|
3971 | typename E, typename F, typename G, typename H, typename I, |
---|
3972 | typename J, typename K, typename L, typename M, typename N, |
---|
3973 | typename O |
---|
3974 | > |
---|
3975 | struct bound_member_action<RT, ClassT, |
---|
3976 | A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { |
---|
3977 | |
---|
3978 | typedef RT result_type; |
---|
3979 | typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); |
---|
3980 | typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const; |
---|
3981 | typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type |
---|
3982 | mem_func_ptr_t; |
---|
3983 | |
---|
3984 | template < |
---|
3985 | typename A_, typename B_, typename C_, typename D_, |
---|
3986 | typename E_, typename F_, typename G_, typename H_, typename I_, |
---|
3987 | typename J_, typename K_, typename L_, typename M_, typename N_, |
---|
3988 | typename O_ |
---|
3989 | > |
---|
3990 | struct result { typedef result_type type; }; |
---|
3991 | |
---|
3992 | template <typename CT> |
---|
3993 | bound_member_action(CT & obj_, mem_func_ptr_t fptr_) |
---|
3994 | : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} |
---|
3995 | |
---|
3996 | result_type operator()( |
---|
3997 | A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o |
---|
3998 | ) const |
---|
3999 | { |
---|
4000 | return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); |
---|
4001 | } |
---|
4002 | |
---|
4003 | typename impl::as_ptr<ClassT>::pointer_type obj; |
---|
4004 | mem_func_ptr_t fptr; |
---|
4005 | }; |
---|
4006 | |
---|
4007 | ////////////////////////////////// |
---|
4008 | template <typename RT, typename ClassT, |
---|
4009 | typename A, typename B, typename C, typename D, |
---|
4010 | typename E, typename F, typename G, typename H, typename I, |
---|
4011 | typename J, typename K, typename L, typename M, typename N, |
---|
4012 | typename O |
---|
4013 | > |
---|
4014 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
4015 | bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) |
---|
4016 | { |
---|
4017 | return bound_member< |
---|
4018 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); |
---|
4019 | } |
---|
4020 | |
---|
4021 | template <typename RT, typename ClassT, |
---|
4022 | typename A, typename B, typename C, typename D, |
---|
4023 | typename E, typename F, typename G, typename H, typename I, |
---|
4024 | typename J, typename K, typename L, typename M, typename N, |
---|
4025 | typename O |
---|
4026 | > |
---|
4027 | inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
4028 | bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) |
---|
4029 | { |
---|
4030 | return bound_member< |
---|
4031 | RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); |
---|
4032 | } |
---|
4033 | |
---|
4034 | template <typename RT, typename ClassT, |
---|
4035 | typename A, typename B, typename C, typename D, |
---|
4036 | typename E, typename F, typename G, typename H, typename I, |
---|
4037 | typename J, typename K, typename L, typename M, typename N, |
---|
4038 | typename O |
---|
4039 | > |
---|
4040 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
4041 | bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) |
---|
4042 | { |
---|
4043 | return bound_member< |
---|
4044 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); |
---|
4045 | } |
---|
4046 | |
---|
4047 | template <typename RT, typename ClassT, |
---|
4048 | typename A, typename B, typename C, typename D, |
---|
4049 | typename E, typename F, typename G, typename H, typename I, |
---|
4050 | typename J, typename K, typename L, typename M, typename N, |
---|
4051 | typename O |
---|
4052 | > |
---|
4053 | inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> |
---|
4054 | bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) |
---|
4055 | { |
---|
4056 | return bound_member< |
---|
4057 | RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); |
---|
4058 | } |
---|
4059 | |
---|
4060 | #endif |
---|
4061 | #endif |
---|
4062 | #endif |
---|
4063 | #endif |
---|
4064 | |
---|
4065 | } // namespace phoenix |
---|
4066 | |
---|
4067 | #endif |
---|