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