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