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