Line data Source code
1 : #ifndef BOOST_BIND_BIND_HPP_INCLUDED
2 : #define BOOST_BIND_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-2004 Peter Dimov and Multi Media Ltd.
14 : // Copyright (c) 2001 David Abrahams
15 : // Copyright (c) 2005 Peter Dimov
16 : //
17 : // Distributed under the Boost Software License, Version 1.0. (See
18 : // accompanying file LICENSE_1_0.txt or copy at
19 : // http://www.boost.org/LICENSE_1_0.txt)
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/is_placeholder.hpp>
29 : #include <boost/bind/arg.hpp>
30 : #include <boost/detail/workaround.hpp>
31 : #include <boost/visit_each.hpp>
32 : #include <boost/core/enable_if.hpp>
33 : #include <boost/core/is_same.hpp>
34 :
35 : #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
36 : #include <utility> // std::forward
37 : #endif
38 :
39 : // Borland-specific bug, visit_each() silently fails to produce code
40 :
41 : #if defined(__BORLANDC__)
42 : # define BOOST_BIND_VISIT_EACH boost::visit_each
43 : #else
44 : # define BOOST_BIND_VISIT_EACH visit_each
45 : #endif
46 :
47 : #include <boost/bind/storage.hpp>
48 :
49 : #ifdef BOOST_MSVC
50 : # pragma warning(push)
51 : # pragma warning(disable: 4512) // assignment operator could not be generated
52 : #endif
53 :
54 : namespace boost
55 : {
56 :
57 : template<class T> class weak_ptr;
58 :
59 : namespace _bi // implementation details
60 : {
61 :
62 : // result_traits
63 :
64 : template<class R, class F> struct result_traits
65 : {
66 : typedef R type;
67 : };
68 :
69 : #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
70 :
71 : struct unspecified {};
72 :
73 : template<class F> struct result_traits<unspecified, F>
74 : {
75 : typedef typename F::result_type type;
76 : };
77 :
78 : template<class F> struct result_traits< unspecified, reference_wrapper<F> >
79 : {
80 : typedef typename F::result_type type;
81 : };
82 :
83 : #endif
84 :
85 : // ref_compare
86 :
87 : template<class T> bool ref_compare( T const & a, T const & b, long )
88 : {
89 : return a == b;
90 : }
91 :
92 : template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
93 : {
94 : return true;
95 : }
96 :
97 : template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
98 : {
99 : return true;
100 : }
101 :
102 : template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
103 : {
104 : return a.get_pointer() == b.get_pointer();
105 : }
106 :
107 : // bind_t forward declaration for listN
108 :
109 : template<class R, class F, class L> class bind_t;
110 :
111 : template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
112 : {
113 : return a.compare( b );
114 : }
115 :
116 : // value
117 :
118 21550600 : template<class T> class value
119 : {
120 : public:
121 :
122 2394554 : value(T const & t): t_(t) {}
123 :
124 241 : T & get() { return t_; }
125 : T const & get() const { return t_; }
126 :
127 : bool operator==(value const & rhs) const
128 : {
129 : return t_ == rhs.t_;
130 : }
131 :
132 : private:
133 :
134 : T t_;
135 : };
136 :
137 : // ref_compare for weak_ptr
138 :
139 : template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
140 : {
141 : return !(a.get() < b.get()) && !(b.get() < a.get());
142 : }
143 :
144 : // type
145 :
146 : template<class T> class type {};
147 :
148 : // unwrap
149 :
150 : template<class F> struct unwrapper
151 : {
152 241 : static inline F & unwrap( F & f, long )
153 : {
154 : return f;
155 : }
156 :
157 : template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
158 : {
159 : return rf.get();
160 : }
161 :
162 : template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
163 : {
164 : return _mfi::dm<R, T>( pm );
165 : }
166 : };
167 :
168 : // listN
169 :
170 : class list0
171 : {
172 : public:
173 :
174 0 : list0() {}
175 :
176 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
177 :
178 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
179 :
180 0 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
181 :
182 : 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); }
183 :
184 : 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); }
185 :
186 : template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
187 : {
188 : return unwrapper<F>::unwrap(f, 0)();
189 : }
190 :
191 : template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
192 : {
193 : return unwrapper<F const>::unwrap(f, 0)();
194 : }
195 :
196 : template<class F, class A> void operator()(type<void>, F & f, A &, int)
197 : {
198 : unwrapper<F>::unwrap(f, 0)();
199 : }
200 :
201 : template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
202 : {
203 : unwrapper<F const>::unwrap(f, 0)();
204 : }
205 :
206 : template<class V> void accept(V &) const
207 : {
208 : }
209 :
210 : bool operator==(list0 const &) const
211 : {
212 : return true;
213 : }
214 : };
215 :
216 : #ifdef BOOST_MSVC
217 : // MSVC is bright enough to realise that the parameter rhs
218 : // in operator==may be unused for some template argument types:
219 : #pragma warning(push)
220 : #pragma warning(disable:4100)
221 : #endif
222 :
223 : template< class A1 > class list1: private storage1< A1 >
224 : {
225 : private:
226 :
227 : typedef storage1< A1 > base_type;
228 :
229 : public:
230 :
231 0 : explicit list1( A1 a1 ): base_type( a1 ) {}
232 :
233 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
234 :
235 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
236 :
237 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
238 :
239 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
240 :
241 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
242 :
243 : 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); }
244 :
245 : 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); }
246 :
247 0 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
248 : {
249 0 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
250 : }
251 :
252 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
253 : {
254 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
255 : }
256 :
257 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
258 : {
259 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
260 : }
261 :
262 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
263 : {
264 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
265 : }
266 :
267 : template<class V> void accept(V & v) const
268 : {
269 : base_type::accept(v);
270 : }
271 :
272 : bool operator==(list1 const & rhs) const
273 : {
274 : return ref_compare(base_type::a1_, rhs.a1_, 0);
275 : }
276 : };
277 :
278 : struct logical_and;
279 : struct logical_or;
280 :
281 : template< class A1, class A2 > class list2: private storage2< A1, A2 >
282 : {
283 : private:
284 :
285 : typedef storage2< A1, A2 > base_type;
286 :
287 : public:
288 :
289 44 : list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
290 :
291 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
292 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
293 :
294 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
295 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
296 :
297 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
298 :
299 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
300 :
301 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
302 :
303 : 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); }
304 :
305 : 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); }
306 :
307 241 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
308 : {
309 241 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
310 : }
311 :
312 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
313 : {
314 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
315 : }
316 :
317 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
318 : {
319 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
320 : }
321 :
322 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
323 : {
324 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
325 : }
326 :
327 : template<class A> bool operator()( type<bool>, logical_and & /*f*/, A & a, int )
328 : {
329 : return a[ base_type::a1_ ] && a[ base_type::a2_ ];
330 : }
331 :
332 : template<class A> bool operator()( type<bool>, logical_and const & /*f*/, A & a, int ) const
333 : {
334 : return a[ base_type::a1_ ] && a[ base_type::a2_ ];
335 : }
336 :
337 : template<class A> bool operator()( type<bool>, logical_or & /*f*/, A & a, int )
338 : {
339 : return a[ base_type::a1_ ] || a[ base_type::a2_ ];
340 : }
341 :
342 : template<class A> bool operator()( type<bool>, logical_or const & /*f*/, A & a, int ) const
343 : {
344 : return a[ base_type::a1_ ] || a[ base_type::a2_ ];
345 : }
346 :
347 : template<class V> void accept(V & v) const
348 : {
349 : base_type::accept(v);
350 : }
351 :
352 : bool operator==(list2 const & rhs) const
353 : {
354 : return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
355 : }
356 : };
357 :
358 2394510 : template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
359 : {
360 : private:
361 :
362 : typedef storage3< A1, A2, A3 > base_type;
363 :
364 : public:
365 :
366 4789020 : list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
367 :
368 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
369 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
370 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
371 :
372 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
373 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
374 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
375 :
376 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
377 :
378 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
379 :
380 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
381 :
382 : 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); }
383 :
384 : 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); }
385 :
386 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
387 : {
388 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
389 : }
390 :
391 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
392 : {
393 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
394 : }
395 :
396 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
397 : {
398 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
399 : }
400 :
401 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
402 : {
403 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
404 : }
405 :
406 : template<class V> void accept(V & v) const
407 : {
408 : base_type::accept(v);
409 : }
410 :
411 : bool operator==(list3 const & rhs) const
412 : {
413 : return
414 :
415 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
416 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
417 : ref_compare( base_type::a3_, rhs.a3_, 0 );
418 : }
419 : };
420 :
421 : template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
422 : {
423 : private:
424 :
425 : typedef storage4< A1, A2, A3, A4 > base_type;
426 :
427 : public:
428 :
429 : list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
430 :
431 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
432 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
433 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
434 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
435 :
436 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
437 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
438 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
439 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
440 :
441 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
442 :
443 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
444 :
445 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
446 :
447 : 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); }
448 :
449 : 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); }
450 :
451 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
452 : {
453 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
454 : }
455 :
456 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
457 : {
458 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
459 : }
460 :
461 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
462 : {
463 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
464 : }
465 :
466 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
467 : {
468 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
469 : }
470 :
471 : template<class V> void accept(V & v) const
472 : {
473 : base_type::accept(v);
474 : }
475 :
476 : bool operator==(list4 const & rhs) const
477 : {
478 : return
479 :
480 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
481 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
482 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
483 : ref_compare( base_type::a4_, rhs.a4_, 0 );
484 : }
485 : };
486 :
487 : template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
488 : {
489 : private:
490 :
491 : typedef storage5< A1, A2, A3, A4, A5 > base_type;
492 :
493 : public:
494 :
495 0 : list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
496 :
497 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
498 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
499 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
500 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
501 : A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
502 :
503 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
504 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
505 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
506 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
507 : A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
508 :
509 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
510 :
511 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
512 :
513 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
514 :
515 : 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); }
516 :
517 : 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); }
518 :
519 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
520 : {
521 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
522 : }
523 :
524 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
525 : {
526 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
527 : }
528 :
529 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
530 : {
531 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
532 : }
533 :
534 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
535 : {
536 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
537 : }
538 :
539 : template<class V> void accept(V & v) const
540 : {
541 : base_type::accept(v);
542 : }
543 :
544 : bool operator==(list5 const & rhs) const
545 : {
546 : return
547 :
548 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
549 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
550 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
551 : ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
552 : ref_compare( base_type::a5_, rhs.a5_, 0 );
553 : }
554 : };
555 :
556 : template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
557 : {
558 : private:
559 :
560 : typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
561 :
562 : public:
563 :
564 : list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
565 :
566 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
567 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
568 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
569 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
570 : A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
571 : A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
572 :
573 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
574 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
575 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
576 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
577 : A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
578 : A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
579 :
580 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
581 :
582 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
583 :
584 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
585 :
586 : 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); }
587 :
588 : 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); }
589 :
590 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
591 : {
592 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
593 : }
594 :
595 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
596 : {
597 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
598 : }
599 :
600 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
601 : {
602 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
603 : }
604 :
605 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
606 : {
607 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
608 : }
609 :
610 : template<class V> void accept(V & v) const
611 : {
612 : base_type::accept(v);
613 : }
614 :
615 : bool operator==(list6 const & rhs) const
616 : {
617 : return
618 :
619 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
620 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
621 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
622 : ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
623 : ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
624 : ref_compare( base_type::a6_, rhs.a6_, 0 );
625 : }
626 : };
627 :
628 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 >
629 : {
630 : private:
631 :
632 : typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
633 :
634 : public:
635 :
636 : list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
637 :
638 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
639 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
640 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
641 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
642 : A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
643 : A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
644 : A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
645 :
646 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
647 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
648 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
649 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
650 : A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
651 : A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
652 : A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
653 :
654 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
655 :
656 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
657 :
658 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
659 :
660 : 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); }
661 :
662 : 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); }
663 :
664 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
665 : {
666 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
667 : }
668 :
669 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
670 : {
671 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
672 : }
673 :
674 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
675 : {
676 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
677 : }
678 :
679 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
680 : {
681 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
682 : }
683 :
684 : template<class V> void accept(V & v) const
685 : {
686 : base_type::accept(v);
687 : }
688 :
689 : bool operator==(list7 const & rhs) const
690 : {
691 : return
692 :
693 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
694 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
695 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
696 : ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
697 : ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
698 : ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
699 : ref_compare( base_type::a7_, rhs.a7_, 0 );
700 : }
701 : };
702 :
703 : template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
704 : {
705 : private:
706 :
707 : typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
708 :
709 : public:
710 :
711 : list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
712 :
713 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
714 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
715 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
716 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
717 : A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
718 : A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
719 : A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
720 : A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
721 :
722 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
723 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
724 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
725 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
726 : A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
727 : A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
728 : A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
729 : A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
730 :
731 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
732 :
733 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
734 :
735 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
736 :
737 : 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); }
738 :
739 : 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); }
740 :
741 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
742 : {
743 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
744 : }
745 :
746 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
747 : {
748 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
749 : }
750 :
751 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
752 : {
753 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
754 : }
755 :
756 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
757 : {
758 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
759 : }
760 :
761 : template<class V> void accept(V & v) const
762 : {
763 : base_type::accept(v);
764 : }
765 :
766 : bool operator==(list8 const & rhs) const
767 : {
768 : return
769 :
770 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
771 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
772 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
773 : ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
774 : ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
775 : ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
776 : ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
777 : ref_compare( base_type::a8_, rhs.a8_, 0 );
778 : }
779 : };
780 :
781 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >
782 : {
783 : private:
784 :
785 : typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
786 :
787 : public:
788 :
789 : list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {}
790 :
791 : A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
792 : A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
793 : A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
794 : A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
795 : A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
796 : A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
797 : A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
798 : A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
799 : A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
800 :
801 : A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
802 : A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
803 : A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
804 : A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
805 : A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
806 : A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
807 : A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
808 : A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
809 : A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; }
810 :
811 : template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
812 :
813 : template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
814 :
815 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
816 :
817 : 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); }
818 :
819 : 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); }
820 :
821 : template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
822 : {
823 : return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
824 : }
825 :
826 : template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
827 : {
828 : return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
829 : }
830 :
831 : template<class F, class A> void operator()(type<void>, F & f, A & a, int)
832 : {
833 : unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
834 : }
835 :
836 : template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
837 : {
838 : unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
839 : }
840 :
841 : template<class V> void accept(V & v) const
842 : {
843 : base_type::accept(v);
844 : }
845 :
846 : bool operator==(list9 const & rhs) const
847 : {
848 : return
849 :
850 : ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
851 : ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
852 : ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
853 : ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
854 : ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
855 : ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
856 : ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
857 : ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
858 : ref_compare( base_type::a9_, rhs.a9_, 0 );
859 : }
860 : };
861 :
862 : #ifdef BOOST_MSVC
863 : #pragma warning(pop)
864 : #endif
865 :
866 : // bind_t
867 :
868 : #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
869 :
870 : template< class A1 > class rrlist1
871 : {
872 : private:
873 :
874 : A1 & a1_; // not A1&& because of msvc-10.0
875 :
876 : public:
877 :
878 44779941 : explicit rrlist1( A1 & a1 ): a1_( a1 ) {}
879 :
880 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); } // not static_cast because of g++ 4.9
881 :
882 241 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
883 :
884 241 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
885 :
886 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
887 :
888 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
889 :
890 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
891 : {
892 : rrlist1<A1&> a( a1_ );
893 : return b.eval( a );
894 : }
895 :
896 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
897 : {
898 : rrlist1<A1&> a( a1_ );
899 : return b.eval( a );
900 : }
901 : };
902 :
903 : template< class A1, class A2 > class rrlist2
904 : {
905 : private:
906 :
907 : A1 & a1_;
908 : A2 & a2_;
909 :
910 : public:
911 :
912 : rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {}
913 :
914 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
915 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
916 :
917 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
918 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
919 :
920 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
921 :
922 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
923 :
924 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
925 :
926 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
927 : {
928 : rrlist2<A1&, A2&> a( a1_, a2_ );
929 : return b.eval( a );
930 : }
931 :
932 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
933 : {
934 : rrlist2<A1&, A2&> a( a1_, a2_ );
935 : return b.eval( a );
936 : }
937 : };
938 :
939 : template< class A1, class A2, class A3 > class rrlist3
940 : {
941 : private:
942 :
943 : A1 & a1_;
944 : A2 & a2_;
945 : A3 & a3_;
946 :
947 : public:
948 :
949 : rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {}
950 :
951 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
952 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
953 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
954 :
955 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
956 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
957 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
958 :
959 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
960 :
961 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
962 :
963 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
964 :
965 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
966 : {
967 : rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
968 : return b.eval( a );
969 : }
970 :
971 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
972 : {
973 : rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
974 : return b.eval( a );
975 : }
976 : };
977 :
978 : template< class A1, class A2, class A3, class A4 > class rrlist4
979 : {
980 : private:
981 :
982 : A1 & a1_;
983 : A2 & a2_;
984 : A3 & a3_;
985 : A4 & a4_;
986 :
987 : public:
988 :
989 0 : rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {}
990 :
991 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
992 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
993 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
994 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
995 :
996 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
997 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
998 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
999 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1000 :
1001 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1002 :
1003 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1004 :
1005 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1006 :
1007 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1008 : {
1009 : rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
1010 : return b.eval( a );
1011 : }
1012 :
1013 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1014 : {
1015 : rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
1016 : return b.eval( a );
1017 : }
1018 : };
1019 :
1020 : template< class A1, class A2, class A3, class A4, class A5 > class rrlist5
1021 : {
1022 : private:
1023 :
1024 : A1 & a1_;
1025 : A2 & a2_;
1026 : A3 & a3_;
1027 : A4 & a4_;
1028 : A5 & a5_;
1029 :
1030 : public:
1031 :
1032 : rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {}
1033 :
1034 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1035 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1036 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1037 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1038 : A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1039 :
1040 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1041 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1042 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1043 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1044 : A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1045 :
1046 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1047 :
1048 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1049 :
1050 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1051 :
1052 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1053 : {
1054 : rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
1055 : return b.eval( a );
1056 : }
1057 :
1058 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1059 : {
1060 : rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
1061 : return b.eval( a );
1062 : }
1063 : };
1064 :
1065 : template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6
1066 : {
1067 : private:
1068 :
1069 : A1 & a1_;
1070 : A2 & a2_;
1071 : A3 & a3_;
1072 : A4 & a4_;
1073 : A5 & a5_;
1074 : A6 & a6_;
1075 :
1076 : public:
1077 :
1078 : rrlist6( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ) {}
1079 :
1080 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1081 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1082 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1083 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1084 : A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1085 : A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1086 :
1087 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1088 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1089 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1090 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1091 : A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1092 : A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1093 :
1094 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1095 :
1096 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1097 :
1098 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1099 :
1100 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1101 : {
1102 : rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
1103 : return b.eval( a );
1104 : }
1105 :
1106 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1107 : {
1108 : rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
1109 : return b.eval( a );
1110 : }
1111 : };
1112 :
1113 : template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7
1114 : {
1115 : private:
1116 :
1117 : A1 & a1_;
1118 : A2 & a2_;
1119 : A3 & a3_;
1120 : A4 & a4_;
1121 : A5 & a5_;
1122 : A6 & a6_;
1123 : A7 & a7_;
1124 :
1125 : public:
1126 :
1127 : rrlist7( 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 ) {}
1128 :
1129 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1130 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1131 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1132 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1133 : A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1134 : A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1135 : A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1136 :
1137 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1138 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1139 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1140 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1141 : A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1142 : A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1143 : A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1144 :
1145 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1146 :
1147 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1148 :
1149 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1150 :
1151 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1152 : {
1153 : rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
1154 : return b.eval( a );
1155 : }
1156 :
1157 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1158 : {
1159 : rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
1160 : return b.eval( a );
1161 : }
1162 : };
1163 :
1164 : template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8
1165 : {
1166 : private:
1167 :
1168 : A1 & a1_;
1169 : A2 & a2_;
1170 : A3 & a3_;
1171 : A4 & a4_;
1172 : A5 & a5_;
1173 : A6 & a6_;
1174 : A7 & a7_;
1175 : A8 & a8_;
1176 :
1177 : public:
1178 :
1179 : rrlist8( 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 ) {}
1180 :
1181 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1182 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1183 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1184 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1185 : A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1186 : A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1187 : A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1188 : A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
1189 :
1190 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1191 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1192 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1193 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1194 : A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1195 : A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1196 : A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1197 : A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
1198 :
1199 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1200 :
1201 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1202 :
1203 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1204 :
1205 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1206 : {
1207 : rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
1208 : return b.eval( a );
1209 : }
1210 :
1211 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1212 : {
1213 : rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
1214 : return b.eval( a );
1215 : }
1216 : };
1217 :
1218 : template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9
1219 : {
1220 : private:
1221 :
1222 : A1 & a1_;
1223 : A2 & a2_;
1224 : A3 & a3_;
1225 : A4 & a4_;
1226 : A5 & a5_;
1227 : A6 & a6_;
1228 : A7 & a7_;
1229 : A8 & a8_;
1230 : A9 & a9_;
1231 :
1232 : public:
1233 :
1234 : rrlist9( 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 ) {}
1235 :
1236 : A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1237 : A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1238 : A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1239 : A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1240 : A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1241 : A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1242 : A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1243 : A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
1244 : A9 && operator[] (boost::arg<9>) const { return std::forward<A9>( a9_ ); }
1245 :
1246 : A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1247 : A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1248 : A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1249 : A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1250 : A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1251 : A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1252 : A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1253 : A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
1254 : A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward<A9>( a9_ ); }
1255 :
1256 : template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1257 :
1258 : template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1259 :
1260 : template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1261 :
1262 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1263 : {
1264 : rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
1265 : return b.eval( a );
1266 : }
1267 :
1268 : template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1269 : {
1270 : rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
1271 : return b.eval( a );
1272 : }
1273 : };
1274 :
1275 4789020 : template<class R, class F, class L> class bind_t
1276 : {
1277 : private:
1278 :
1279 : F f_;
1280 : L l_;
1281 :
1282 : public:
1283 :
1284 : typedef typename result_traits<R, F>::type result_type;
1285 : typedef bind_t this_type;
1286 :
1287 2394554 : bind_t( F f, L const & l ): f_( f ), l_( l ) {}
1288 :
1289 : //
1290 :
1291 0 : result_type operator()()
1292 : {
1293 : list0 a;
1294 0 : return l_( type<result_type>(), f_, a, 0 );
1295 : }
1296 :
1297 : result_type operator()() const
1298 : {
1299 : list0 a;
1300 : return l_( type<result_type>(), f_, a, 0 );
1301 : }
1302 :
1303 44779941 : template<class A1> result_type operator()( A1 && a1 )
1304 : {
1305 44779941 : rrlist1< A1 > a( a1 );
1306 44779853 : return l_( type<result_type>(), f_, a, 0 );
1307 : }
1308 :
1309 : template<class A1> result_type operator()( A1 && a1 ) const
1310 : {
1311 : rrlist1< A1 > a( a1 );
1312 : return l_(type<result_type>(), f_, a, 0);
1313 : }
1314 :
1315 : template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 )
1316 : {
1317 : rrlist2< A1, A2 > a( a1, a2 );
1318 : return l_( type<result_type>(), f_, a, 0 );
1319 : }
1320 :
1321 : template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 ) const
1322 : {
1323 : rrlist2< A1, A2 > a( a1, a2 );
1324 : return l_( type<result_type>(), f_, a, 0 );
1325 : }
1326 :
1327 : template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 )
1328 : {
1329 : rrlist3< A1, A2, A3 > a( a1, a2, a3 );
1330 : return l_( type<result_type>(), f_, a, 0 );
1331 : }
1332 :
1333 : template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const
1334 : {
1335 : rrlist3< A1, A2, A3 > a( a1, a2, a3 );
1336 : return l_( type<result_type>(), f_, a, 0 );
1337 : }
1338 :
1339 0 : template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
1340 : {
1341 0 : rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
1342 0 : return l_( type<result_type>(), f_, a, 0 );
1343 : }
1344 :
1345 : template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const
1346 : {
1347 : rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
1348 : return l_( type<result_type>(), f_, a, 0 );
1349 : }
1350 :
1351 : template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
1352 : {
1353 : rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
1354 : return l_( type<result_type>(), f_, a, 0 );
1355 : }
1356 :
1357 : template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) const
1358 : {
1359 : rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
1360 : return l_( type<result_type>(), f_, a, 0 );
1361 : }
1362 :
1363 : template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
1364 : {
1365 : rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
1366 : return l_( type<result_type>(), f_, a, 0 );
1367 : }
1368 :
1369 : template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) const
1370 : {
1371 : rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
1372 : return l_( type<result_type>(), f_, a, 0 );
1373 : }
1374 :
1375 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
1376 : {
1377 : rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
1378 : return l_( type<result_type>(), f_, a, 0 );
1379 : }
1380 :
1381 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) const
1382 : {
1383 : rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
1384 : return l_( type<result_type>(), f_, a, 0 );
1385 : }
1386 :
1387 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
1388 : {
1389 : rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
1390 : return l_( type<result_type>(), f_, a, 0 );
1391 : }
1392 :
1393 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) const
1394 : {
1395 : rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
1396 : return l_( type<result_type>(), f_, a, 0 );
1397 : }
1398 :
1399 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
1400 : {
1401 : rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
1402 : return l_( type<result_type>(), f_, a, 0 );
1403 : }
1404 :
1405 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) const
1406 : {
1407 : rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
1408 : return l_( type<result_type>(), f_, a, 0 );
1409 : }
1410 :
1411 : //
1412 :
1413 : template<class A> result_type eval( A & a )
1414 : {
1415 : return l_( type<result_type>(), f_, a, 0 );
1416 : }
1417 :
1418 : template<class A> result_type eval( A & a ) const
1419 : {
1420 : return l_( type<result_type>(), f_, a, 0 );
1421 : }
1422 :
1423 : template<class V> void accept( V & v ) const
1424 : {
1425 : #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
1426 : using boost::visit_each;
1427 : #endif
1428 :
1429 : BOOST_BIND_VISIT_EACH( v, f_, 0 );
1430 : l_.accept( v );
1431 : }
1432 :
1433 : bool compare( this_type const & rhs ) const
1434 : {
1435 : return ref_compare( f_, rhs.f_, 0 ) && l_ == rhs.l_;
1436 : }
1437 : };
1438 :
1439 : #elif !defined( BOOST_NO_VOID_RETURNS )
1440 :
1441 : template<class R, class F, class L> class bind_t
1442 : {
1443 : public:
1444 :
1445 : typedef bind_t this_type;
1446 :
1447 : bind_t(F f, L const & l): f_(f), l_(l) {}
1448 :
1449 : #define BOOST_BIND_RETURN return
1450 : #include <boost/bind/bind_template.hpp>
1451 : #undef BOOST_BIND_RETURN
1452 :
1453 : };
1454 :
1455 : #else // no void returns
1456 :
1457 : template<class R> struct bind_t_generator
1458 : {
1459 :
1460 : template<class F, class L> class implementation
1461 : {
1462 : public:
1463 :
1464 : typedef implementation this_type;
1465 :
1466 : implementation(F f, L const & l): f_(f), l_(l) {}
1467 :
1468 : #define BOOST_BIND_RETURN return
1469 : #include <boost/bind/bind_template.hpp>
1470 : #undef BOOST_BIND_RETURN
1471 :
1472 : };
1473 :
1474 : };
1475 :
1476 : template<> struct bind_t_generator<void>
1477 : {
1478 :
1479 : template<class F, class L> class implementation
1480 : {
1481 : private:
1482 :
1483 : typedef void R;
1484 :
1485 : public:
1486 :
1487 : typedef implementation this_type;
1488 :
1489 : implementation(F f, L const & l): f_(f), l_(l) {}
1490 :
1491 : #define BOOST_BIND_RETURN
1492 : #include <boost/bind/bind_template.hpp>
1493 : #undef BOOST_BIND_RETURN
1494 :
1495 : };
1496 :
1497 : };
1498 :
1499 : template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
1500 : {
1501 : public:
1502 :
1503 : bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
1504 :
1505 : };
1506 :
1507 : #endif
1508 :
1509 : // function_equal
1510 :
1511 : #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
1512 :
1513 : // put overloads in _bi, rely on ADL
1514 :
1515 : # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1516 :
1517 : template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
1518 : {
1519 : return a.compare(b);
1520 : }
1521 :
1522 : # else
1523 :
1524 : template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
1525 : {
1526 : return a.compare(b);
1527 : }
1528 :
1529 : # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1530 :
1531 : #else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
1532 :
1533 : // put overloads in boost
1534 :
1535 : } // namespace _bi
1536 :
1537 : # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1538 :
1539 : template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
1540 : {
1541 : return a.compare(b);
1542 : }
1543 :
1544 : # else
1545 :
1546 : template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
1547 : {
1548 : return a.compare(b);
1549 : }
1550 :
1551 : # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1552 :
1553 : namespace _bi
1554 : {
1555 :
1556 : #endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
1557 :
1558 : // add_value
1559 :
1560 : #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
1561 :
1562 : #if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x582) )
1563 :
1564 : template<class T> struct add_value
1565 : {
1566 : typedef _bi::value<T> type;
1567 : };
1568 :
1569 : #else
1570 :
1571 : template< class T, int I > struct add_value_2
1572 : {
1573 : typedef boost::arg<I> type;
1574 : };
1575 :
1576 : template< class T > struct add_value_2< T, 0 >
1577 : {
1578 : typedef _bi::value< T > type;
1579 : };
1580 :
1581 : template<class T> struct add_value
1582 : {
1583 : typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
1584 : };
1585 :
1586 : #endif
1587 :
1588 : template<class T> struct add_value< value<T> >
1589 : {
1590 : typedef _bi::value<T> type;
1591 : };
1592 :
1593 : template<class T> struct add_value< reference_wrapper<T> >
1594 : {
1595 : typedef reference_wrapper<T> type;
1596 : };
1597 :
1598 : template<int I> struct add_value< arg<I> >
1599 : {
1600 : typedef boost::arg<I> type;
1601 : };
1602 :
1603 : template<int I> struct add_value< arg<I> (*) () >
1604 : {
1605 : typedef boost::arg<I> (*type) ();
1606 : };
1607 :
1608 : template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
1609 : {
1610 : typedef bind_t<R, F, L> type;
1611 : };
1612 :
1613 : #else
1614 :
1615 : template<int I> struct _avt_0;
1616 :
1617 : template<> struct _avt_0<1>
1618 : {
1619 : template<class T> struct inner
1620 : {
1621 : typedef T type;
1622 : };
1623 : };
1624 :
1625 : template<> struct _avt_0<2>
1626 : {
1627 : template<class T> struct inner
1628 : {
1629 : typedef value<T> type;
1630 : };
1631 : };
1632 :
1633 : typedef char (&_avt_r1) [1];
1634 : typedef char (&_avt_r2) [2];
1635 :
1636 : template<class T> _avt_r1 _avt_f(value<T>);
1637 : template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1638 : template<int I> _avt_r1 _avt_f(arg<I>);
1639 : template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1640 : template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1641 :
1642 : _avt_r2 _avt_f(...);
1643 :
1644 : template<class T> struct add_value
1645 : {
1646 : static T t();
1647 : typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1648 : };
1649 :
1650 : #endif
1651 :
1652 : // list_av_N
1653 :
1654 : template<class A1> struct list_av_1
1655 : {
1656 : typedef typename add_value<A1>::type B1;
1657 : typedef list1<B1> type;
1658 : };
1659 :
1660 : template<class A1, class A2> struct list_av_2
1661 : {
1662 : typedef typename add_value<A1>::type B1;
1663 : typedef typename add_value<A2>::type B2;
1664 : typedef list2<B1, B2> type;
1665 : };
1666 :
1667 : template<class A1, class A2, class A3> struct list_av_3
1668 : {
1669 : typedef typename add_value<A1>::type B1;
1670 : typedef typename add_value<A2>::type B2;
1671 : typedef typename add_value<A3>::type B3;
1672 : typedef list3<B1, B2, B3> type;
1673 : };
1674 :
1675 : template<class A1, class A2, class A3, class A4> struct list_av_4
1676 : {
1677 : typedef typename add_value<A1>::type B1;
1678 : typedef typename add_value<A2>::type B2;
1679 : typedef typename add_value<A3>::type B3;
1680 : typedef typename add_value<A4>::type B4;
1681 : typedef list4<B1, B2, B3, B4> type;
1682 : };
1683 :
1684 : template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1685 : {
1686 : typedef typename add_value<A1>::type B1;
1687 : typedef typename add_value<A2>::type B2;
1688 : typedef typename add_value<A3>::type B3;
1689 : typedef typename add_value<A4>::type B4;
1690 : typedef typename add_value<A5>::type B5;
1691 : typedef list5<B1, B2, B3, B4, B5> type;
1692 : };
1693 :
1694 : template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1695 : {
1696 : typedef typename add_value<A1>::type B1;
1697 : typedef typename add_value<A2>::type B2;
1698 : typedef typename add_value<A3>::type B3;
1699 : typedef typename add_value<A4>::type B4;
1700 : typedef typename add_value<A5>::type B5;
1701 : typedef typename add_value<A6>::type B6;
1702 : typedef list6<B1, B2, B3, B4, B5, B6> type;
1703 : };
1704 :
1705 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1706 : {
1707 : typedef typename add_value<A1>::type B1;
1708 : typedef typename add_value<A2>::type B2;
1709 : typedef typename add_value<A3>::type B3;
1710 : typedef typename add_value<A4>::type B4;
1711 : typedef typename add_value<A5>::type B5;
1712 : typedef typename add_value<A6>::type B6;
1713 : typedef typename add_value<A7>::type B7;
1714 : typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1715 : };
1716 :
1717 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1718 : {
1719 : typedef typename add_value<A1>::type B1;
1720 : typedef typename add_value<A2>::type B2;
1721 : typedef typename add_value<A3>::type B3;
1722 : typedef typename add_value<A4>::type B4;
1723 : typedef typename add_value<A5>::type B5;
1724 : typedef typename add_value<A6>::type B6;
1725 : typedef typename add_value<A7>::type B7;
1726 : typedef typename add_value<A8>::type B8;
1727 : typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1728 : };
1729 :
1730 : template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1731 : {
1732 : typedef typename add_value<A1>::type B1;
1733 : typedef typename add_value<A2>::type B2;
1734 : typedef typename add_value<A3>::type B3;
1735 : typedef typename add_value<A4>::type B4;
1736 : typedef typename add_value<A5>::type B5;
1737 : typedef typename add_value<A6>::type B6;
1738 : typedef typename add_value<A7>::type B7;
1739 : typedef typename add_value<A8>::type B8;
1740 : typedef typename add_value<A9>::type B9;
1741 : typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1742 : };
1743 :
1744 : // operator!
1745 :
1746 : struct logical_not
1747 : {
1748 : template<class V> bool operator()(V const & v) const { return !v; }
1749 : };
1750 :
1751 : template<class R, class F, class L>
1752 : bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
1753 : operator! (bind_t<R, F, L> const & f)
1754 : {
1755 : typedef list1< bind_t<R, F, L> > list_type;
1756 : return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
1757 : }
1758 :
1759 : // relational operators
1760 :
1761 : #define BOOST_BIND_OPERATOR( op, name ) \
1762 : \
1763 : struct name \
1764 : { \
1765 : template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
1766 : }; \
1767 : \
1768 : template<class R, class F, class L, class A2> \
1769 : bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
1770 : operator op (bind_t<R, F, L> const & f, A2 a2) \
1771 : { \
1772 : typedef typename add_value<A2>::type B2; \
1773 : typedef list2< bind_t<R, F, L>, B2> list_type; \
1774 : return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
1775 : }
1776 :
1777 : BOOST_BIND_OPERATOR( ==, equal )
1778 : BOOST_BIND_OPERATOR( !=, not_equal )
1779 :
1780 : BOOST_BIND_OPERATOR( <, less )
1781 : BOOST_BIND_OPERATOR( <=, less_equal )
1782 :
1783 : BOOST_BIND_OPERATOR( >, greater )
1784 : BOOST_BIND_OPERATOR( >=, greater_equal )
1785 :
1786 : BOOST_BIND_OPERATOR( &&, logical_and )
1787 : BOOST_BIND_OPERATOR( ||, logical_or )
1788 :
1789 : #undef BOOST_BIND_OPERATOR
1790 :
1791 : #if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
1792 :
1793 : // resolve ambiguity with rel_ops
1794 :
1795 : #define BOOST_BIND_OPERATOR( op, name ) \
1796 : \
1797 : template<class R, class F, class L> \
1798 : bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
1799 : operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
1800 : { \
1801 : typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
1802 : return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
1803 : }
1804 :
1805 : BOOST_BIND_OPERATOR( !=, not_equal )
1806 : BOOST_BIND_OPERATOR( <=, less_equal )
1807 : BOOST_BIND_OPERATOR( >, greater )
1808 : BOOST_BIND_OPERATOR( >=, greater_equal )
1809 :
1810 : #endif
1811 :
1812 : // visit_each, ADL
1813 :
1814 : #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) \
1815 : && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
1816 :
1817 : template<class V, class T> void visit_each( V & v, value<T> const & t, int )
1818 : {
1819 : using boost::visit_each;
1820 : BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
1821 : }
1822 :
1823 : template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
1824 : {
1825 : t.accept( v );
1826 : }
1827 :
1828 : #endif
1829 :
1830 : } // namespace _bi
1831 :
1832 : // visit_each, no ADL
1833 :
1834 : #if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) \
1835 : || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
1836 :
1837 : template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
1838 : {
1839 : BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
1840 : }
1841 :
1842 : template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
1843 : {
1844 : t.accept( v );
1845 : }
1846 :
1847 : #endif
1848 :
1849 : // is_bind_expression
1850 :
1851 : template< class T > struct is_bind_expression
1852 : {
1853 : enum _vt { value = 0 };
1854 : };
1855 :
1856 : #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
1857 :
1858 : template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
1859 : {
1860 : enum _vt { value = 1 };
1861 : };
1862 :
1863 : #endif
1864 :
1865 : // bind
1866 :
1867 : #ifndef BOOST_BIND
1868 : #define BOOST_BIND bind
1869 : #endif
1870 :
1871 : // generic function objects
1872 :
1873 : template<class R, class F>
1874 : _bi::bind_t<R, F, _bi::list0>
1875 : BOOST_BIND(F f)
1876 : {
1877 : typedef _bi::list0 list_type;
1878 : return _bi::bind_t<R, F, list_type> (f, list_type());
1879 : }
1880 :
1881 : template<class R, class F, class A1>
1882 : _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1883 : BOOST_BIND(F f, A1 a1)
1884 : {
1885 : typedef typename _bi::list_av_1<A1>::type list_type;
1886 : return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1887 : }
1888 :
1889 : template<class R, class F, class A1, class A2>
1890 : _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1891 : BOOST_BIND(F f, A1 a1, A2 a2)
1892 : {
1893 : typedef typename _bi::list_av_2<A1, A2>::type list_type;
1894 : return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1895 : }
1896 :
1897 : template<class R, class F, class A1, class A2, class A3>
1898 : _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1899 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1900 : {
1901 : typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1902 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1903 : }
1904 :
1905 : template<class R, class F, class A1, class A2, class A3, class A4>
1906 : _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1907 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1908 : {
1909 : typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1910 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1911 : }
1912 :
1913 : template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1914 : _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1915 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1916 : {
1917 : typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1918 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1919 : }
1920 :
1921 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1922 : _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1923 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1924 : {
1925 : typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1926 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1927 : }
1928 :
1929 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1930 : _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1931 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1932 : {
1933 : typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1934 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1935 : }
1936 :
1937 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1938 : _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1939 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1940 : {
1941 : typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1942 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1943 : }
1944 :
1945 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1946 : _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1947 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1948 : {
1949 : typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1950 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1951 : }
1952 :
1953 : // generic function objects, alternative syntax
1954 :
1955 : template<class R, class F>
1956 : _bi::bind_t<R, F, _bi::list0>
1957 : BOOST_BIND(boost::type<R>, F f)
1958 : {
1959 : typedef _bi::list0 list_type;
1960 : return _bi::bind_t<R, F, list_type> (f, list_type());
1961 : }
1962 :
1963 : template<class R, class F, class A1>
1964 : _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1965 : BOOST_BIND(boost::type<R>, F f, A1 a1)
1966 : {
1967 : typedef typename _bi::list_av_1<A1>::type list_type;
1968 : return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1969 : }
1970 :
1971 : template<class R, class F, class A1, class A2>
1972 : _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1973 44 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1974 : {
1975 : typedef typename _bi::list_av_2<A1, A2>::type list_type;
1976 44 : return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1977 : }
1978 :
1979 : template<class R, class F, class A1, class A2, class A3>
1980 : _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1981 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1982 : {
1983 : typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1984 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1985 : }
1986 :
1987 : template<class R, class F, class A1, class A2, class A3, class A4>
1988 : _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1989 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1990 : {
1991 : typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1992 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1993 : }
1994 :
1995 : template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1996 : _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1997 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1998 : {
1999 : typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
2000 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
2001 : }
2002 :
2003 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
2004 : _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
2005 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
2006 : {
2007 : typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
2008 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
2009 : }
2010 :
2011 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
2012 : _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
2013 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
2014 : {
2015 : typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
2016 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
2017 : }
2018 :
2019 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
2020 : _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
2021 : BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
2022 : {
2023 : typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
2024 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
2025 : }
2026 :
2027 : template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
2028 : _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
2029 : 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)
2030 : {
2031 : typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
2032 : return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
2033 : }
2034 :
2035 : #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
2036 :
2037 : // adaptable function objects
2038 :
2039 : template<class F>
2040 : _bi::bind_t<_bi::unspecified, F, _bi::list0>
2041 : BOOST_BIND(F f)
2042 : {
2043 : typedef _bi::list0 list_type;
2044 : return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
2045 : }
2046 :
2047 : template<class F, class A1>
2048 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
2049 : BOOST_BIND(F f, A1 a1)
2050 : {
2051 : typedef typename _bi::list_av_1<A1>::type list_type;
2052 : return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
2053 : }
2054 :
2055 : template<class F, class A1, class A2>
2056 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
2057 : BOOST_BIND(F f, A1 a1, A2 a2)
2058 : {
2059 : typedef typename _bi::list_av_2<A1, A2>::type list_type;
2060 : return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
2061 : }
2062 :
2063 : template<class F, class A1, class A2, class A3>
2064 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
2065 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
2066 : {
2067 : typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
2068 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
2069 : }
2070 :
2071 : template<class F, class A1, class A2, class A3, class A4>
2072 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
2073 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
2074 : {
2075 : typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
2076 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
2077 : }
2078 :
2079 : template<class F, class A1, class A2, class A3, class A4, class A5>
2080 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
2081 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
2082 : {
2083 : typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
2084 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
2085 : }
2086 :
2087 : template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
2088 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
2089 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
2090 : {
2091 : typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
2092 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
2093 : }
2094 :
2095 : template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
2096 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
2097 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
2098 : {
2099 : typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
2100 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
2101 : }
2102 :
2103 : template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
2104 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
2105 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
2106 : {
2107 : typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
2108 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
2109 : }
2110 :
2111 : template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
2112 : _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
2113 : BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
2114 : {
2115 : typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
2116 : return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
2117 : }
2118 :
2119 : #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
2120 :
2121 : // function pointers
2122 :
2123 : #define BOOST_BIND_CC
2124 : #define BOOST_BIND_ST
2125 : #define BOOST_BIND_NOEXCEPT
2126 :
2127 : #include <boost/bind/bind_cc.hpp>
2128 :
2129 : # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2130 : # undef BOOST_BIND_NOEXCEPT
2131 : # define BOOST_BIND_NOEXCEPT noexcept
2132 : # include <boost/bind/bind_cc.hpp>
2133 : # endif
2134 :
2135 : #undef BOOST_BIND_CC
2136 : #undef BOOST_BIND_ST
2137 : #undef BOOST_BIND_NOEXCEPT
2138 :
2139 : #if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
2140 :
2141 : #define BOOST_BIND_CC __stdcall
2142 : #define BOOST_BIND_ST
2143 : #define BOOST_BIND_NOEXCEPT
2144 :
2145 : #include <boost/bind/bind_cc.hpp>
2146 :
2147 : #undef BOOST_BIND_CC
2148 : #undef BOOST_BIND_ST
2149 : #undef BOOST_BIND_NOEXCEPT
2150 :
2151 : #endif
2152 :
2153 : #if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
2154 :
2155 : #define BOOST_BIND_CC __fastcall
2156 : #define BOOST_BIND_ST
2157 : #define BOOST_BIND_NOEXCEPT
2158 :
2159 : #include <boost/bind/bind_cc.hpp>
2160 :
2161 : #undef BOOST_BIND_CC
2162 : #undef BOOST_BIND_ST
2163 : #undef BOOST_BIND_NOEXCEPT
2164 :
2165 : #endif
2166 :
2167 : #ifdef BOOST_BIND_ENABLE_PASCAL
2168 :
2169 : #define BOOST_BIND_ST pascal
2170 : #define BOOST_BIND_CC
2171 : #define BOOST_BIND_NOEXCEPT
2172 :
2173 : #include <boost/bind/bind_cc.hpp>
2174 :
2175 : #undef BOOST_BIND_ST
2176 : #undef BOOST_BIND_CC
2177 : #undef BOOST_BIND_NOEXCEPT
2178 :
2179 : #endif
2180 :
2181 : // member function pointers
2182 :
2183 : #define BOOST_BIND_MF_NAME(X) X
2184 : #define BOOST_BIND_MF_CC
2185 : #define BOOST_BIND_MF_NOEXCEPT
2186 :
2187 : #include <boost/bind/bind_mf_cc.hpp>
2188 : #include <boost/bind/bind_mf2_cc.hpp>
2189 :
2190 : # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2191 : # undef BOOST_BIND_MF_NOEXCEPT
2192 : # define BOOST_BIND_MF_NOEXCEPT noexcept
2193 : # include <boost/bind/bind_mf_cc.hpp>
2194 : # endif
2195 :
2196 : #undef BOOST_BIND_MF_NAME
2197 : #undef BOOST_BIND_MF_CC
2198 : #undef BOOST_BIND_MF_NOEXCEPT
2199 :
2200 : #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
2201 :
2202 : #define BOOST_BIND_MF_NAME(X) X##_cdecl
2203 : #define BOOST_BIND_MF_CC __cdecl
2204 : #define BOOST_BIND_MF_NOEXCEPT
2205 :
2206 : #include <boost/bind/bind_mf_cc.hpp>
2207 : #include <boost/bind/bind_mf2_cc.hpp>
2208 :
2209 : #undef BOOST_BIND_MF_NAME
2210 : #undef BOOST_BIND_MF_CC
2211 : #undef BOOST_BIND_MF_NOEXCEPT
2212 :
2213 : #endif
2214 :
2215 : #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
2216 :
2217 : #define BOOST_BIND_MF_NAME(X) X##_stdcall
2218 : #define BOOST_BIND_MF_CC __stdcall
2219 : #define BOOST_BIND_MF_NOEXCEPT
2220 :
2221 : #include <boost/bind/bind_mf_cc.hpp>
2222 : #include <boost/bind/bind_mf2_cc.hpp>
2223 :
2224 : #undef BOOST_BIND_MF_NAME
2225 : #undef BOOST_BIND_MF_CC
2226 : #undef BOOST_BIND_MF_NOEXCEPT
2227 :
2228 : #endif
2229 :
2230 : #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
2231 :
2232 : #define BOOST_BIND_MF_NAME(X) X##_fastcall
2233 : #define BOOST_BIND_MF_CC __fastcall
2234 : #define BOOST_BIND_MF_NOEXCEPT
2235 :
2236 : #include <boost/bind/bind_mf_cc.hpp>
2237 : #include <boost/bind/bind_mf2_cc.hpp>
2238 :
2239 : #undef BOOST_BIND_MF_NAME
2240 : #undef BOOST_BIND_MF_CC
2241 : #undef BOOST_BIND_MF_NOEXCEPT
2242 :
2243 : #endif
2244 :
2245 : // data member pointers
2246 :
2247 : #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
2248 : || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x620 ) ) )
2249 :
2250 : template<class R, class T, class A1>
2251 : _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
2252 : BOOST_BIND(R T::*f, A1 a1)
2253 : {
2254 : typedef _mfi::dm<R, T> F;
2255 : typedef typename _bi::list_av_1<A1>::type list_type;
2256 : return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
2257 : }
2258 :
2259 : #else
2260 :
2261 : namespace _bi
2262 : {
2263 :
2264 : template< class Pm, int I > struct add_cref;
2265 :
2266 : template< class M, class T > struct add_cref< M T::*, 0 >
2267 : {
2268 : typedef M type;
2269 : };
2270 :
2271 : template< class M, class T > struct add_cref< M T::*, 1 >
2272 : {
2273 : #ifdef BOOST_MSVC
2274 : #pragma warning(push)
2275 : #pragma warning(disable:4180)
2276 : #endif
2277 : typedef M const & type;
2278 : #ifdef BOOST_MSVC
2279 : #pragma warning(pop)
2280 : #endif
2281 : };
2282 :
2283 : template< class R, class T > struct add_cref< R (T::*) (), 1 >
2284 : {
2285 : typedef void type;
2286 : };
2287 :
2288 : #if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION
2289 :
2290 : template< class R, class T > struct add_cref< R (T::*) () const, 1 >
2291 : {
2292 : typedef void type;
2293 : };
2294 :
2295 : #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2296 :
2297 : template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 >
2298 : {
2299 : typedef void type;
2300 : };
2301 :
2302 : #endif // __cpp_noexcept_function_type
2303 :
2304 : #endif // __IBMCPP__
2305 :
2306 : template<class R> struct isref
2307 : {
2308 : enum value_type { value = 0 };
2309 : };
2310 :
2311 : template<class R> struct isref< R& >
2312 : {
2313 : enum value_type { value = 1 };
2314 : };
2315 :
2316 : template<class R> struct isref< R* >
2317 : {
2318 : enum value_type { value = 1 };
2319 : };
2320 :
2321 : template<class Pm, class A1> struct dm_result
2322 : {
2323 : typedef typename add_cref< Pm, 1 >::type type;
2324 : };
2325 :
2326 : template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
2327 : {
2328 : typedef typename bind_t<R, F, L>::result_type result_type;
2329 : typedef typename add_cref< Pm, isref< result_type >::value >::type type;
2330 : };
2331 :
2332 : } // namespace _bi
2333 :
2334 : template< class A1, class M, class T >
2335 :
2336 : _bi::bind_t<
2337 : typename _bi::dm_result< M T::*, A1 >::type,
2338 : _mfi::dm<M, T>,
2339 : typename _bi::list_av_1<A1>::type
2340 : >
2341 :
2342 : BOOST_BIND( M T::*f, A1 a1 )
2343 : {
2344 : typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
2345 : typedef _mfi::dm<M, T> F;
2346 : typedef typename _bi::list_av_1<A1>::type list_type;
2347 : return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
2348 : }
2349 :
2350 : #endif
2351 :
2352 : } // namespace boost
2353 :
2354 : #ifndef BOOST_BIND_NO_PLACEHOLDERS
2355 :
2356 : # include <boost/bind/placeholders.hpp>
2357 :
2358 : #endif
2359 :
2360 : #ifdef BOOST_MSVC
2361 : # pragma warning(default: 4512) // assignment operator could not be generated
2362 : # pragma warning(pop)
2363 : #endif
2364 :
2365 : #endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
|