]> git.lyx.org Git - lyx.git/blob - boost/boost/bind.hpp
ddbabbd75c7beeed478969bc184fd69903c0ee44
[lyx.git] / boost / boost / bind.hpp
1 #ifndef BOOST_BIND_HPP_INCLUDED
2 #define BOOST_BIND_HPP_INCLUDED
3
4 #if _MSC_VER >= 1020
5 #pragma once
6 #endif
7
8 //
9 //  bind.hpp - binds function objects to arguments
10 //
11 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
12 //  Copyright (c) 2001 David Abrahams
13 //
14 //  Permission to copy, use, modify, sell and distribute this software
15 //  is granted provided this copyright notice appears in all copies.
16 //  This software is provided "as is" without express or implied
17 //  warranty, and with no claim as to its suitability for any purpose.
18 //
19 //  See http://www.boost.org/libs/bind/bind.html for documentation.
20 //
21
22 #include <boost/config.hpp>
23 #include <boost/ref.hpp>
24 #include <boost/mem_fn.hpp>
25 #include <boost/bind/arg.hpp>
26
27 // Borland-specific bug, visit_each() silently fails to produce code
28
29 #if defined(__BORLANDC__)
30 #  define BOOST_BIND_VISIT_EACH boost::visit_each
31 #else
32 #  define BOOST_BIND_VISIT_EACH visit_each
33 #endif
34
35 #ifdef BOOST_MSVC
36 # pragma warning(push)
37 # pragma warning(disable: 4512) // assignment operator could not be generated
38 #endif
39
40 namespace boost
41 {
42
43 namespace _bi // implementation details
44 {
45
46 // result_traits
47
48 template<class R, class F> struct result_traits
49 {
50     typedef R type;
51 };
52
53 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
54
55 struct unspecified {};
56
57 template<class F> struct result_traits<unspecified, F>
58 {
59     typedef typename F::result_type type;
60 };
61
62 #endif
63
64 // bind_t forward declaration for listN
65
66 template<class R, class F, class L> class bind_t;
67
68 // value
69
70 template<class T> class value
71 {
72 public:
73
74     value(T const & t): t_(t) {}
75
76     T & get() { return t_; }
77     T const & get() const { return t_; }
78
79 private:
80
81     T t_;
82 };
83
84 // type
85
86 template<class T> class type {};
87
88 // listN
89
90 #ifdef BOOST_NO_VOID_RETURNS
91
92 template <class R> struct evaluator0;
93 template <class R> struct evaluator1;
94 template <class R> struct evaluator2;
95 template <class R> struct evaluator3;
96 template <class R> struct evaluator4;
97 template <class R> struct evaluator5;
98 template <class R> struct evaluator6;
99 template <class R> struct evaluator7;
100 template <class R> struct evaluator8;
101 template <class R> struct evaluator9;
102
103 #endif
104
105 class list0
106 {
107 public:
108
109     list0() {}
110
111     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
112
113     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
114
115     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
116
117     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
118
119     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
120
121     template<class R, class F, class A> R operator()(type<R>, F f, A &) const
122     {
123         return f();
124     }
125
126     template<class V> void accept(V &) const
127     {
128     }
129
130 #ifdef BOOST_NO_VOID_RETURNS
131
132     template<class R> struct evaluator
133     {
134         typedef evaluator0<R> type;
135     };
136
137 #endif
138
139 };
140
141 template<class A1> class list1
142 {
143 public:
144
145     explicit list1(A1 a1): a1_(a1) {}
146
147     A1 operator[] (arg<1>) const { return a1_; }
148
149     A1 operator[] (arg<1> (*) ()) const { return a1_; }
150
151     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
152
153     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
154
155     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
156
157     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
158
159     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
160
161     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
162     {
163         return f(a[a1_]);
164     }
165
166     template<class V> void accept(V & v) const
167     {
168         BOOST_BIND_VISIT_EACH(v, a1_, 0);
169     }
170
171 #ifdef BOOST_NO_VOID_RETURNS
172
173     template<class R> struct evaluator
174     {
175         typedef evaluator1<R> type;
176     };
177
178 #else
179
180 private:
181
182 #endif
183
184     A1 a1_;
185 };
186
187 template<class A1, class A2> class list2
188 {
189 public:
190
191     list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
192
193     A1 operator[] (arg<1>) const { return a1_; }
194     A2 operator[] (arg<2>) const { return a2_; }
195
196     A1 operator[] (arg<1> (*) ()) const { return a1_; }
197     A2 operator[] (arg<2> (*) ()) const { return a2_; }
198
199     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
200
201     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
202
203     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
204
205     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
206
207     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
208
209     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
210     {
211         return f(a[a1_], a[a2_]);
212     }
213
214     template<class V> void accept(V & v) const
215     {
216         BOOST_BIND_VISIT_EACH(v, a1_, 0);
217         BOOST_BIND_VISIT_EACH(v, a2_, 0);
218     }
219
220 #ifdef BOOST_NO_VOID_RETURNS
221
222     template<class R> struct evaluator
223     {
224         typedef evaluator2<R> type;
225     };
226
227 #else
228
229 private:
230
231 #endif
232
233     A1 a1_;
234     A2 a2_;
235 };
236
237 template<class A1, class A2, class A3> class list3
238 {
239 public:
240
241     list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
242
243     A1 operator[] (arg<1>) const { return a1_; }
244     A2 operator[] (arg<2>) const { return a2_; }
245     A3 operator[] (arg<3>) const { return a3_; }
246
247     A1 operator[] (arg<1> (*) ()) const { return a1_; }
248     A2 operator[] (arg<2> (*) ()) const { return a2_; }
249     A3 operator[] (arg<3> (*) ()) const { return a3_; }
250
251     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
252
253     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
254
255     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
256
257     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
258
259     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
260
261     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
262     {
263         return f(a[a1_], a[a2_], a[a3_]);
264     }
265
266     template<class V> void accept(V & v) const
267     {
268         BOOST_BIND_VISIT_EACH(v, a1_, 0);
269         BOOST_BIND_VISIT_EACH(v, a2_, 0);
270         BOOST_BIND_VISIT_EACH(v, a3_, 0);
271     }
272
273 #ifdef BOOST_NO_VOID_RETURNS
274
275     template<class R> struct evaluator
276     {
277         typedef evaluator3<R> type;
278     };
279
280 #else
281
282 private:
283
284 #endif
285
286     A1 a1_;
287     A2 a2_;
288     A3 a3_;
289 };
290
291 template<class A1, class A2, class A3, class A4> class list4
292 {
293 public:
294
295     list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
296
297     A1 operator[] (arg<1>) const { return a1_; }
298     A2 operator[] (arg<2>) const { return a2_; }
299     A3 operator[] (arg<3>) const { return a3_; }
300     A4 operator[] (arg<4>) const { return a4_; }
301
302     A1 operator[] (arg<1> (*) ()) const { return a1_; }
303     A2 operator[] (arg<2> (*) ()) const { return a2_; }
304     A3 operator[] (arg<3> (*) ()) const { return a3_; }
305     A4 operator[] (arg<4> (*) ()) const { return a4_; }
306
307     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
308
309     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
310
311     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
312
313     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
314
315     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
316
317     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
318     {
319         return f(a[a1_], a[a2_], a[a3_], a[a4_]);
320     }
321
322     template<class V> void accept(V & v) const
323     {
324         BOOST_BIND_VISIT_EACH(v, a1_, 0);
325         BOOST_BIND_VISIT_EACH(v, a2_, 0);
326         BOOST_BIND_VISIT_EACH(v, a3_, 0);
327         BOOST_BIND_VISIT_EACH(v, a4_, 0);
328     }
329
330 #ifdef BOOST_NO_VOID_RETURNS
331
332     template<class R> struct evaluator
333     {
334         typedef evaluator4<R> type;
335     };
336
337 #else
338
339 private:
340
341 #endif
342
343     A1 a1_;
344     A2 a2_;
345     A3 a3_;
346     A4 a4_;
347 };
348
349 template<class A1, class A2, class A3, class A4, class A5> class list5
350 {
351 public:
352
353     list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
354
355     A1 operator[] (arg<1>) const { return a1_; }
356     A2 operator[] (arg<2>) const { return a2_; }
357     A3 operator[] (arg<3>) const { return a3_; }
358     A4 operator[] (arg<4>) const { return a4_; }
359     A5 operator[] (arg<5>) const { return a5_; }
360
361     A1 operator[] (arg<1> (*) ()) const { return a1_; }
362     A2 operator[] (arg<2> (*) ()) const { return a2_; }
363     A3 operator[] (arg<3> (*) ()) const { return a3_; }
364     A4 operator[] (arg<4> (*) ()) const { return a4_; }
365     A5 operator[] (arg<5> (*) ()) const { return a5_; }
366
367     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
368
369     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
370
371     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
372
373     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
374
375     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
376
377     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
378     {
379         return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
380     }
381
382     template<class V> void accept(V & v) const
383     {
384         BOOST_BIND_VISIT_EACH(v, a1_, 0);
385         BOOST_BIND_VISIT_EACH(v, a2_, 0);
386         BOOST_BIND_VISIT_EACH(v, a3_, 0);
387         BOOST_BIND_VISIT_EACH(v, a4_, 0);
388         BOOST_BIND_VISIT_EACH(v, a5_, 0);
389     }
390
391 #ifdef BOOST_NO_VOID_RETURNS
392
393     template<class R> struct evaluator
394     {
395         typedef evaluator5<R> type;
396     };
397
398 #else
399
400 private:
401
402 #endif
403
404     A1 a1_;
405     A2 a2_;
406     A3 a3_;
407     A4 a4_;
408     A5 a5_;
409 };
410
411 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
412 {
413 public:
414
415     list6(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6) {}
416
417     A1 operator[] (arg<1>) const { return a1_; }
418     A2 operator[] (arg<2>) const { return a2_; }
419     A3 operator[] (arg<3>) const { return a3_; }
420     A4 operator[] (arg<4>) const { return a4_; }
421     A5 operator[] (arg<5>) const { return a5_; }
422     A6 operator[] (arg<6>) const { return a6_; }
423
424     A1 operator[] (arg<1> (*) ()) const { return a1_; }
425     A2 operator[] (arg<2> (*) ()) const { return a2_; }
426     A3 operator[] (arg<3> (*) ()) const { return a3_; }
427     A4 operator[] (arg<4> (*) ()) const { return a4_; }
428     A5 operator[] (arg<5> (*) ()) const { return a5_; }
429     A6 operator[] (arg<6> (*) ()) const { return a6_; }
430
431     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
432
433     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
434
435     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
436
437     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
438
439     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
440
441     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
442     {
443         return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
444     }
445
446     template<class V> void accept(V & v) const
447     {
448         BOOST_BIND_VISIT_EACH(v, a1_, 0);
449         BOOST_BIND_VISIT_EACH(v, a2_, 0);
450         BOOST_BIND_VISIT_EACH(v, a3_, 0);
451         BOOST_BIND_VISIT_EACH(v, a4_, 0);
452         BOOST_BIND_VISIT_EACH(v, a5_, 0);
453         BOOST_BIND_VISIT_EACH(v, a6_, 0);
454     }
455
456 #ifdef BOOST_NO_VOID_RETURNS
457
458     template<class R> struct evaluator
459     {
460         typedef evaluator6<R> type;
461     };
462
463 #else
464
465 private:
466
467 #endif
468
469     A1 a1_;
470     A2 a2_;
471     A3 a3_;
472     A4 a4_;
473     A5 a5_;
474     A6 a6_;
475 };
476
477 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
478 {
479 public:
480
481     list7(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7) {}
482
483     A1 operator[] (arg<1>) const { return a1_; }
484     A2 operator[] (arg<2>) const { return a2_; }
485     A3 operator[] (arg<3>) const { return a3_; }
486     A4 operator[] (arg<4>) const { return a4_; }
487     A5 operator[] (arg<5>) const { return a5_; }
488     A6 operator[] (arg<6>) const { return a6_; }
489     A7 operator[] (arg<7>) const { return a7_; }
490
491     A1 operator[] (arg<1> (*) ()) const { return a1_; }
492     A2 operator[] (arg<2> (*) ()) const { return a2_; }
493     A3 operator[] (arg<3> (*) ()) const { return a3_; }
494     A4 operator[] (arg<4> (*) ()) const { return a4_; }
495     A5 operator[] (arg<5> (*) ()) const { return a5_; }
496     A6 operator[] (arg<6> (*) ()) const { return a6_; }
497     A7 operator[] (arg<7> (*) ()) const { return a7_; }
498
499     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
500
501     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
502
503     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
504
505     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
506
507     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
508
509     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
510     {
511         return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
512     }
513
514     template<class V> void accept(V & v) const
515     {
516         BOOST_BIND_VISIT_EACH(v, a1_, 0);
517         BOOST_BIND_VISIT_EACH(v, a2_, 0);
518         BOOST_BIND_VISIT_EACH(v, a3_, 0);
519         BOOST_BIND_VISIT_EACH(v, a4_, 0);
520         BOOST_BIND_VISIT_EACH(v, a5_, 0);
521         BOOST_BIND_VISIT_EACH(v, a6_, 0);
522         BOOST_BIND_VISIT_EACH(v, a7_, 0);
523     }
524
525 #ifdef BOOST_NO_VOID_RETURNS
526
527     template<class R> struct evaluator
528     {
529         typedef evaluator7<R> type;
530     };
531
532 #else
533
534 private:
535
536 #endif
537
538     A1 a1_;
539     A2 a2_;
540     A3 a3_;
541     A4 a4_;
542     A5 a5_;
543     A6 a6_;
544     A7 a7_;
545 };
546
547 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
548 {
549 public:
550
551     list8(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8) {}
552
553     A1 operator[] (arg<1>) const { return a1_; }
554     A2 operator[] (arg<2>) const { return a2_; }
555     A3 operator[] (arg<3>) const { return a3_; }
556     A4 operator[] (arg<4>) const { return a4_; }
557     A5 operator[] (arg<5>) const { return a5_; }
558     A6 operator[] (arg<6>) const { return a6_; }
559     A7 operator[] (arg<7>) const { return a7_; }
560     A8 operator[] (arg<8>) const { return a8_; }
561
562     A1 operator[] (arg<1> (*) ()) const { return a1_; }
563     A2 operator[] (arg<2> (*) ()) const { return a2_; }
564     A3 operator[] (arg<3> (*) ()) const { return a3_; }
565     A4 operator[] (arg<4> (*) ()) const { return a4_; }
566     A5 operator[] (arg<5> (*) ()) const { return a5_; }
567     A6 operator[] (arg<6> (*) ()) const { return a6_; }
568     A7 operator[] (arg<7> (*) ()) const { return a7_; }
569     A8 operator[] (arg<8> (*) ()) const { return a8_; }
570
571     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
572
573     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
574
575     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
576
577     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
578
579     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
580
581     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
582     {
583         return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
584     }
585
586     template<class V> void accept(V & v) const
587     {
588         BOOST_BIND_VISIT_EACH(v, a1_, 0);
589         BOOST_BIND_VISIT_EACH(v, a2_, 0);
590         BOOST_BIND_VISIT_EACH(v, a3_, 0);
591         BOOST_BIND_VISIT_EACH(v, a4_, 0);
592         BOOST_BIND_VISIT_EACH(v, a5_, 0);
593         BOOST_BIND_VISIT_EACH(v, a6_, 0);
594         BOOST_BIND_VISIT_EACH(v, a7_, 0);
595         BOOST_BIND_VISIT_EACH(v, a8_, 0);
596     }
597
598 #ifdef BOOST_NO_VOID_RETURNS
599
600     template<class R> struct evaluator
601     {
602         typedef evaluator8<R> type;
603     };
604
605 #else
606
607 private:
608
609 #endif
610
611     A1 a1_;
612     A2 a2_;
613     A3 a3_;
614     A4 a4_;
615     A5 a5_;
616     A6 a6_;
617     A7 a7_;
618     A8 a8_;
619 };
620
621 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
622 {
623 public:
624
625     list9(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8), a9_(a9) {}
626
627     A1 operator[] (arg<1>) const { return a1_; }
628     A2 operator[] (arg<2>) const { return a2_; }
629     A3 operator[] (arg<3>) const { return a3_; }
630     A4 operator[] (arg<4>) const { return a4_; }
631     A5 operator[] (arg<5>) const { return a5_; }
632     A6 operator[] (arg<6>) const { return a6_; }
633     A7 operator[] (arg<7>) const { return a7_; }
634     A8 operator[] (arg<8>) const { return a8_; }
635     A9 operator[] (arg<9>) const { return a9_; }
636
637     A1 operator[] (arg<1> (*) ()) const { return a1_; }
638     A2 operator[] (arg<2> (*) ()) const { return a2_; }
639     A3 operator[] (arg<3> (*) ()) const { return a3_; }
640     A4 operator[] (arg<4> (*) ()) const { return a4_; }
641     A5 operator[] (arg<5> (*) ()) const { return a5_; }
642     A6 operator[] (arg<6> (*) ()) const { return a6_; }
643     A7 operator[] (arg<7> (*) ()) const { return a7_; }
644     A8 operator[] (arg<8> (*) ()) const { return a8_; }
645     A9 operator[] (arg<9> (*) ()) const { return a9_; }
646
647     template<class T> T & operator[] (value<T> & v) const { return v.get(); }
648
649     template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
650
651     template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
652
653     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
654
655     template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
656
657     template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
658     {
659         return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
660     }
661
662     template<class V> void accept(V & v) const
663     {
664         BOOST_BIND_VISIT_EACH(v, a1_, 0);
665         BOOST_BIND_VISIT_EACH(v, a2_, 0);
666         BOOST_BIND_VISIT_EACH(v, a3_, 0);
667         BOOST_BIND_VISIT_EACH(v, a4_, 0);
668         BOOST_BIND_VISIT_EACH(v, a5_, 0);
669         BOOST_BIND_VISIT_EACH(v, a6_, 0);
670         BOOST_BIND_VISIT_EACH(v, a7_, 0);
671         BOOST_BIND_VISIT_EACH(v, a8_, 0);
672         BOOST_BIND_VISIT_EACH(v, a9_, 0);
673     }
674
675 #ifdef BOOST_NO_VOID_RETURNS
676
677     template<class R> struct evaluator
678     {
679         typedef evaluator9<R> type;
680     };
681
682 #else
683
684 private:
685
686 #endif
687
688     A1 a1_;
689     A2 a2_;
690     A3 a3_;
691     A4 a4_;
692     A5 a5_;
693     A6 a6_;
694     A7 a7_;
695     A8 a8_;
696     A9 a9_;
697 };
698
699 #ifdef BOOST_NO_VOID_RETURNS
700
701 template <class R> struct evaluator0
702 {
703     template<class L, class F, class A>
704     static R eval(L const&, F f, A &)
705     {
706         return f();
707     }
708 };
709
710 template <> struct evaluator0<void>
711 {
712     template<class L, class F, class A>
713     static void eval(L const&, F f, A &)
714     {
715         f();
716     }
717 };
718
719 template <class R> struct evaluator1
720 {
721     template<class L, class F, class A>
722     static R eval(L const& l, F f, A & a)
723     {
724         return f(a[l.a1_]);
725     }
726 };
727
728 template <> struct evaluator1<void>
729 {
730     template<class L, class F, class A>
731     static void eval(L const& l, F f, A & a)
732     {
733         f(a[l.a1_]);
734     }
735 };
736
737 template <class R> struct evaluator2
738 {
739     template<class L, class F, class A>
740     static R eval(L const& l, F f, A & a)
741     {
742         return f(a[l.a1_], a[l.a2_]);
743     }
744 };
745
746 template <> struct evaluator2<void>
747 {
748     template<class L, class F, class A>
749     static void eval(L const& l, F f, A & a)
750     {
751         f(a[l.a1_], a[l.a2_]);
752     }
753 };
754
755 template <class R> struct evaluator3
756 {
757     template<class L, class F, class A>
758     static R eval(L const& l, F f, A & a)
759     {
760         return f(a[l.a1_], a[l.a2_], a[l.a3_]);
761     }
762 };
763
764 template <> struct evaluator3<void>
765 {
766     template<class L, class F, class A>
767     static void eval(L const& l, F f, A & a)
768     {
769         f(a[l.a1_], a[l.a2_], a[l.a3_]);
770     }
771 };
772
773 template <class R> struct evaluator4
774 {
775     template<class L, class F, class A>
776     static R eval(L const& l, F f, A & a)
777     {
778         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
779     }
780 };
781
782 template <> struct evaluator4<void>
783 {
784     template<class L, class F, class A>
785     static void eval(L const& l, F f, A & a)
786     {
787         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
788     }
789 };
790
791 template <class R> struct evaluator5
792 {
793     template<class L, class F, class A>
794     static R eval(L const& l, F f, A & a)
795     {
796         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
797     }
798 };
799
800 template <> struct evaluator5<void>
801 {
802     template<class L, class F, class A>
803     static void eval(L const& l, F f, A & a)
804     {
805         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
806     }
807 };
808
809 template <class R> struct evaluator6
810 {
811     template<class L, class F, class A>
812     static R eval(L const& l, F f, A & a)
813     {
814         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
815     }
816 };
817
818 template <> struct evaluator6<void>
819 {
820     template<class L, class F, class A>
821     static void eval(L const& l, F f, A & a)
822     {
823         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
824     }
825 };
826
827 template <class R> struct evaluator7
828 {
829     template<class L, class F, class A>
830     static R eval(L const& l, F f, A & a)
831     {
832         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
833     }
834 };
835
836 template <> struct evaluator7<void>
837 {
838     template<class L, class F, class A>
839     static void eval(L const& l, F f, A & a)
840     {
841         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
842     }
843 };
844
845 template <class R> struct evaluator8
846 {
847     template<class L, class F, class A>
848     static R eval(L const& l, F f, A & a)
849     {
850         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
851     }
852 };
853
854 template <> struct evaluator8<void>
855 {
856     template<class L, class F, class A>
857     static void eval(L const& l, F f, A & a)
858     {
859         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
860     }
861 };
862
863 template <class R> struct evaluator9
864 {
865     template<class L, class F, class A>
866     static R eval(L const& l, F f, A & a)
867     {
868         return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
869     }
870 };
871
872 template <> struct evaluator9<void>
873 {
874     template<class L, class F, class A>
875     static void eval(L const& l, F f, A & a)
876     {
877         f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
878     }
879 };
880
881 #endif
882
883 // bind_t
884
885 #ifndef BOOST_NO_VOID_RETURNS
886
887 template<class R, class F, class L> class bind_t
888 {
889 public:
890
891     bind_t(F f, L const & l): f_(f), l_(l) {}
892
893 #define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
894 #include <boost/bind/bind_template.hpp>
895 #undef BOOST_BIND_EVALUATE
896
897 };
898
899 #else
900
901 template<class R> struct bind_t_generator
902 {
903
904 template<class F, class L> class implementation
905 {
906 public:
907
908     implementation(F f, L const & l): f_(f), l_(l) {}
909
910 #define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
911 #include <boost/bind/bind_template.hpp>
912 #undef BOOST_BIND_EVALUATE
913
914 };
915
916 };
917
918 template<> struct bind_t_generator<void>
919 {
920
921 template<class F, class L> class implementation
922 {
923 private:
924
925     typedef void R;
926
927 public:
928
929     implementation(F f, L const & l): f_(f), l_(l) {}
930
931 #define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
932 #include <boost/bind/bind_template.hpp>
933 #undef BOOST_BIND_EVALUATE
934
935 };
936
937 };
938
939 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
940 {
941 public:
942
943     bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
944
945 };
946
947 #endif
948
949 // add_value
950
951 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
952
953 template<class T> struct add_value
954 {
955     typedef value<T> type;
956 };
957
958 template<class T> struct add_value< value<T> >
959 {
960     typedef value<T> type;
961 };
962
963 template<class T> struct add_value< reference_wrapper<T> >
964 {
965     typedef reference_wrapper<T> type;
966 };
967
968 template<int I> struct add_value< arg<I> >
969 {
970     typedef arg<I> type;
971 };
972
973 template<int I> struct add_value< arg<I> (*) () >
974 {
975     typedef arg<I> (*type) ();
976 };
977
978 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
979 {
980     typedef bind_t<R, F, L> type;
981 };
982
983 #else
984
985 template<int I> struct _avt_0;
986
987 template<> struct _avt_0<1>
988 {
989     template<class T> struct inner
990     {
991         typedef T type;
992     };
993 };
994
995 template<> struct _avt_0<2>
996 {
997     template<class T> struct inner
998     {
999         typedef value<T> type;
1000     };
1001 };
1002
1003 typedef char (&_avt_r1) [1];
1004 typedef char (&_avt_r2) [2];
1005
1006 template<class T> _avt_r1 _avt_f(value<T>);
1007 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1008 template<int I> _avt_r1 _avt_f(arg<I>);
1009 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1010 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1011
1012 _avt_r2 _avt_f(...);
1013
1014 template<class T> struct add_value
1015 {
1016     static T t();
1017     typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1018 };
1019
1020 #endif
1021
1022 // list_av_N
1023
1024 template<class A1> struct list_av_1
1025 {
1026     typedef typename add_value<A1>::type B1;
1027     typedef list1<B1> type;
1028 };
1029
1030 template<class A1, class A2> struct list_av_2
1031 {
1032     typedef typename add_value<A1>::type B1;
1033     typedef typename add_value<A2>::type B2;
1034     typedef list2<B1, B2> type;
1035 };
1036
1037 template<class A1, class A2, class A3> struct list_av_3
1038 {
1039     typedef typename add_value<A1>::type B1;
1040     typedef typename add_value<A2>::type B2;
1041     typedef typename add_value<A3>::type B3;
1042     typedef list3<B1, B2, B3> type;
1043 };
1044
1045 template<class A1, class A2, class A3, class A4> struct list_av_4
1046 {
1047     typedef typename add_value<A1>::type B1;
1048     typedef typename add_value<A2>::type B2;
1049     typedef typename add_value<A3>::type B3;
1050     typedef typename add_value<A4>::type B4;
1051     typedef list4<B1, B2, B3, B4> type;
1052 };
1053
1054 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1055 {
1056     typedef typename add_value<A1>::type B1;
1057     typedef typename add_value<A2>::type B2;
1058     typedef typename add_value<A3>::type B3;
1059     typedef typename add_value<A4>::type B4;
1060     typedef typename add_value<A5>::type B5;
1061     typedef list5<B1, B2, B3, B4, B5> type;
1062 };
1063
1064 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1065 {
1066     typedef typename add_value<A1>::type B1;
1067     typedef typename add_value<A2>::type B2;
1068     typedef typename add_value<A3>::type B3;
1069     typedef typename add_value<A4>::type B4;
1070     typedef typename add_value<A5>::type B5;
1071     typedef typename add_value<A6>::type B6;
1072     typedef list6<B1, B2, B3, B4, B5, B6> type;
1073 };
1074
1075 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1076 {
1077     typedef typename add_value<A1>::type B1;
1078     typedef typename add_value<A2>::type B2;
1079     typedef typename add_value<A3>::type B3;
1080     typedef typename add_value<A4>::type B4;
1081     typedef typename add_value<A5>::type B5;
1082     typedef typename add_value<A6>::type B6;
1083     typedef typename add_value<A7>::type B7;
1084     typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1085 };
1086
1087 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1088 {
1089     typedef typename add_value<A1>::type B1;
1090     typedef typename add_value<A2>::type B2;
1091     typedef typename add_value<A3>::type B3;
1092     typedef typename add_value<A4>::type B4;
1093     typedef typename add_value<A5>::type B5;
1094     typedef typename add_value<A6>::type B6;
1095     typedef typename add_value<A7>::type B7;
1096     typedef typename add_value<A8>::type B8;
1097     typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1098 };
1099
1100 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1101 {
1102     typedef typename add_value<A1>::type B1;
1103     typedef typename add_value<A2>::type B2;
1104     typedef typename add_value<A3>::type B3;
1105     typedef typename add_value<A4>::type B4;
1106     typedef typename add_value<A5>::type B5;
1107     typedef typename add_value<A6>::type B6;
1108     typedef typename add_value<A7>::type B7;
1109     typedef typename add_value<A8>::type B8;
1110     typedef typename add_value<A9>::type B9;
1111     typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1112 };
1113
1114 } // namespace _bi
1115
1116 // visit_each
1117
1118 template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
1119 {
1120     BOOST_BIND_VISIT_EACH(v, t.get(), 0);
1121 }
1122
1123 template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
1124 {
1125     t.accept(v);
1126 }
1127
1128 // bind
1129
1130 #ifndef BOOST_BIND
1131 #define BOOST_BIND bind
1132 #endif
1133
1134 // generic function objects
1135
1136 template<class R, class F>
1137     _bi::bind_t<R, F, _bi::list0>
1138     BOOST_BIND(F f)
1139 {
1140     typedef _bi::list0 list_type;
1141     return _bi::bind_t<R, F, list_type> (f, list_type());
1142 }
1143
1144 template<class R, class F, class A1>
1145     _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1146     BOOST_BIND(F f, A1 a1)
1147 {
1148     typedef typename _bi::list_av_1<A1>::type list_type;
1149     return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1150 }
1151
1152 template<class R, class F, class A1, class A2>
1153     _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1154     BOOST_BIND(F f, A1 a1, A2 a2)
1155 {
1156     typedef typename _bi::list_av_2<A1, A2>::type list_type;
1157     return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1158 }
1159
1160 template<class R, class F, class A1, class A2, class A3>
1161     _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1162     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1163 {
1164     typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1165     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1166 }
1167
1168 template<class R, class F, class A1, class A2, class A3, class A4>
1169     _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1170     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1171 {
1172     typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1173     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1174 }
1175
1176 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1177     _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1178     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1179 {
1180     typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1181     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1182 }
1183
1184 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1185     _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1186     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1187 {
1188     typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1189     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1190 }
1191
1192 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1193     _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1194     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1195 {
1196     typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1197     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1198 }
1199
1200 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1201     _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1202     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1203 {
1204     typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1205     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1206 }
1207
1208 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1209     _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1210     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1211 {
1212     typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1213     return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1214 }
1215
1216 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1217
1218 // adaptable function objects
1219
1220 template<class F>
1221     _bi::bind_t<_bi::unspecified, F, _bi::list0>
1222     BOOST_BIND(F f)
1223 {
1224     typedef _bi::list0 list_type;
1225     return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
1226 }
1227
1228 template<class F, class A1>
1229     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
1230     BOOST_BIND(F f, A1 a1)
1231 {
1232     typedef typename _bi::list_av_1<A1>::type list_type;
1233     return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
1234 }
1235
1236 template<class F, class A1, class A2>
1237     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
1238     BOOST_BIND(F f, A1 a1, A2 a2)
1239 {
1240     typedef typename _bi::list_av_2<A1, A2>::type list_type;
1241     return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
1242 }
1243
1244 template<class F, class A1, class A2, class A3>
1245     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
1246     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1247 {
1248     typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1249     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
1250 }
1251
1252 template<class F, class A1, class A2, class A3, class A4>
1253     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1254     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1255 {
1256     typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1257     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
1258 }
1259
1260 template<class F, class A1, class A2, class A3, class A4, class A5>
1261     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1262     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1263 {
1264     typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1265     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1266 }
1267
1268 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
1269     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1270     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1271 {
1272     typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1273     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1274 }
1275
1276 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1277     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1278     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1279 {
1280     typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1281     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1282 }
1283
1284 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1285     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1286     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1287 {
1288     typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1289     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1290 }
1291
1292 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1293     _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1294     BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1295 {
1296     typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1297     return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1298 }
1299
1300 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
1301
1302 // function pointers
1303
1304 #define BOOST_BIND_CC
1305 #define BOOST_BIND_ST
1306
1307 #include <boost/bind/bind_cc.hpp>
1308
1309 #undef BOOST_BIND_CC
1310 #undef BOOST_BIND_ST
1311
1312 #ifdef BOOST_BIND_ENABLE_STDCALL
1313
1314 #define BOOST_BIND_CC __stdcall
1315 #define BOOST_BIND_ST
1316
1317 #include <boost/bind/bind_cc.hpp>
1318
1319 #undef BOOST_BIND_CC
1320 #undef BOOST_BIND_ST
1321
1322 #endif
1323
1324 #ifdef BOOST_BIND_ENABLE_PASCAL
1325
1326 #define BOOST_BIND_ST pascal
1327 #define BOOST_BIND_CC
1328
1329 #include <boost/bind/bind_cc.hpp>
1330
1331 #undef BOOST_BIND_ST
1332 #undef BOOST_BIND_CC
1333
1334 #endif
1335
1336 // member function pointers
1337
1338 #define BOOST_BIND_MF_NAME(X) X
1339 #define BOOST_BIND_MF_CC
1340
1341 #include <boost/bind/bind_mf_cc.hpp>
1342
1343 #undef BOOST_BIND_MF_NAME
1344 #undef BOOST_BIND_MF_CC
1345
1346 #ifdef BOOST_MEM_FN_ENABLE_STDCALL
1347
1348 #define BOOST_BIND_MF_NAME(X) X##_stdcall
1349 #define BOOST_BIND_MF_CC __stdcall
1350
1351 #include <boost/bind/bind_mf_cc.hpp>
1352
1353 #undef BOOST_BIND_MF_NAME
1354 #undef BOOST_BIND_MF_CC
1355
1356 #endif
1357
1358 // data member pointers
1359
1360 template<class R, class T, class A1>
1361     _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
1362     BOOST_BIND(R T::*f, A1 a1)
1363 {
1364     typedef _mfi::dm<R, T> F;
1365     typedef typename _bi::list_av_1<A1>::type list_type;
1366     return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
1367 }
1368
1369 } // namespace boost
1370
1371 #ifndef BOOST_BIND_NO_PLACEHOLDERS
1372
1373 # include <boost/bind/placeholders.hpp>
1374
1375 #endif
1376
1377 #ifdef BOOST_MSVC
1378 # pragma warning(default: 4512) // assignment operator could not be generated
1379 # pragma warning(pop)
1380 #endif
1381
1382 #endif // #ifndef BOOST_BIND_HPP_INCLUDED