File indexing completed on 2024-11-16 09:06:26
0001 #ifndef BOOST_BIND_BIND_HPP_INCLUDED
0002 #define BOOST_BIND_BIND_HPP_INCLUDED
0003
0004
0005
0006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0007 # pragma once
0008 #endif
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include <boost/bind/detail/requires_cxx11.hpp>
0025 #include <boost/config.hpp>
0026 #include <boost/bind/mem_fn.hpp>
0027 #include <boost/type.hpp>
0028 #include <boost/is_placeholder.hpp>
0029 #include <boost/bind/arg.hpp>
0030 #include <boost/bind/detail/result_traits.hpp>
0031 #include <boost/bind/std_placeholders.hpp>
0032 #include <boost/config/workaround.hpp>
0033 #include <boost/visit_each.hpp>
0034 #include <boost/core/ref.hpp>
0035 #include <boost/core/enable_if.hpp>
0036 #include <boost/bind/detail/is_same.hpp>
0037
0038 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
0039 #include <utility> // std::forward
0040 #endif
0041
0042
0043
0044 #if defined(BOOST_BORLANDC)
0045 # define BOOST_BIND_VISIT_EACH boost::visit_each
0046 #else
0047 # define BOOST_BIND_VISIT_EACH visit_each
0048 #endif
0049
0050 #include <boost/bind/storage.hpp>
0051
0052 #ifdef BOOST_MSVC
0053 # pragma warning(push)
0054 # pragma warning(disable: 4512)
0055 #endif
0056
0057 namespace boost
0058 {
0059
0060 template<class T> class weak_ptr;
0061
0062 namespace _bi
0063 {
0064
0065
0066
0067 template<class T> bool ref_compare( T const & a, T const & b, long )
0068 {
0069 return a == b;
0070 }
0071
0072 template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
0073 {
0074 return true;
0075 }
0076
0077 template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
0078 {
0079 return true;
0080 }
0081
0082 template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
0083 {
0084 return a.get_pointer() == b.get_pointer();
0085 }
0086
0087
0088
0089 template<class R, class F, class L> class bind_t;
0090
0091 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 )
0092 {
0093 return a.compare( b );
0094 }
0095
0096
0097
0098 template<class T> class value
0099 {
0100 public:
0101
0102 value(T const & t): t_(t) {}
0103
0104 T & get() { return t_; }
0105 T const & get() const { return t_; }
0106
0107 bool operator==(value const & rhs) const
0108 {
0109 return t_ == rhs.t_;
0110 }
0111
0112 private:
0113
0114 T t_;
0115 };
0116
0117
0118
0119 template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
0120 {
0121 return !(a.get() < b.get()) && !(b.get() < a.get());
0122 }
0123
0124
0125
0126 template<class T> class type {};
0127
0128
0129
0130 template<class F> struct unwrapper
0131 {
0132 static inline F & unwrap( F & f, long )
0133 {
0134 return f;
0135 }
0136
0137 template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
0138 {
0139 return rf.get();
0140 }
0141
0142 template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
0143 {
0144 return _mfi::dm<R, T>( pm );
0145 }
0146 };
0147
0148
0149
0150 class list0
0151 {
0152 public:
0153
0154 list0() {}
0155
0156 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0157
0158 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0159
0160 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0161
0162 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); }
0163
0164 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); }
0165
0166 template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
0167 {
0168 return unwrapper<F>::unwrap(f, 0)();
0169 }
0170
0171 template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
0172 {
0173 return unwrapper<F const>::unwrap(f, 0)();
0174 }
0175
0176 template<class F, class A> void operator()(type<void>, F & f, A &, int)
0177 {
0178 unwrapper<F>::unwrap(f, 0)();
0179 }
0180
0181 template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
0182 {
0183 unwrapper<F const>::unwrap(f, 0)();
0184 }
0185
0186 template<class V> void accept(V &) const
0187 {
0188 }
0189
0190 bool operator==(list0 const &) const
0191 {
0192 return true;
0193 }
0194 };
0195
0196 #ifdef BOOST_MSVC
0197
0198
0199 #pragma warning(push)
0200 #pragma warning(disable:4100)
0201 #endif
0202
0203 template< class A1 > class list1: private storage1< A1 >
0204 {
0205 private:
0206
0207 typedef storage1< A1 > base_type;
0208
0209 public:
0210
0211 explicit list1( A1 a1 ): base_type( a1 ) {}
0212
0213 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0214
0215 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0216
0217 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
0218
0219 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
0220
0221 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0222
0223 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); }
0224
0225 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); }
0226
0227 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0228 {
0229 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
0230 }
0231
0232 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0233 {
0234 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
0235 }
0236
0237 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0238 {
0239 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
0240 }
0241
0242 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0243 {
0244 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
0245 }
0246
0247 template<class V> void accept(V & v) const
0248 {
0249 base_type::accept(v);
0250 }
0251
0252 bool operator==(list1 const & rhs) const
0253 {
0254 return ref_compare(base_type::a1_, rhs.a1_, 0);
0255 }
0256 };
0257
0258 struct logical_and;
0259 struct logical_or;
0260
0261 template< class A1, class A2 > class list2: private storage2< A1, A2 >
0262 {
0263 private:
0264
0265 typedef storage2< A1, A2 > base_type;
0266
0267 public:
0268
0269 list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
0270
0271 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0272 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0273
0274 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0275 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0276
0277 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0278
0279 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0280
0281 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0282
0283 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); }
0284
0285 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); }
0286
0287 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0288 {
0289 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
0290 }
0291
0292 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0293 {
0294 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
0295 }
0296
0297 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0298 {
0299 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
0300 }
0301
0302 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0303 {
0304 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
0305 }
0306
0307 template<class A> bool operator()( type<bool>, logical_and & , A & a, int )
0308 {
0309 return a[ base_type::a1_ ] && a[ base_type::a2_ ];
0310 }
0311
0312 template<class A> bool operator()( type<bool>, logical_and const & , A & a, int ) const
0313 {
0314 return a[ base_type::a1_ ] && a[ base_type::a2_ ];
0315 }
0316
0317 template<class A> bool operator()( type<bool>, logical_or & , A & a, int )
0318 {
0319 return a[ base_type::a1_ ] || a[ base_type::a2_ ];
0320 }
0321
0322 template<class A> bool operator()( type<bool>, logical_or const & , A & a, int ) const
0323 {
0324 return a[ base_type::a1_ ] || a[ base_type::a2_ ];
0325 }
0326
0327 template<class V> void accept(V & v) const
0328 {
0329 base_type::accept(v);
0330 }
0331
0332 bool operator==(list2 const & rhs) const
0333 {
0334 return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
0335 }
0336 };
0337
0338 template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
0339 {
0340 private:
0341
0342 typedef storage3< A1, A2, A3 > base_type;
0343
0344 public:
0345
0346 list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
0347
0348 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0349 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0350 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0351
0352 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0353 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0354 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0355
0356 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0357
0358 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0359
0360 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0361
0362 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); }
0363
0364 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); }
0365
0366 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0367 {
0368 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
0369 }
0370
0371 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0372 {
0373 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
0374 }
0375
0376 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0377 {
0378 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
0379 }
0380
0381 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0382 {
0383 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
0384 }
0385
0386 template<class V> void accept(V & v) const
0387 {
0388 base_type::accept(v);
0389 }
0390
0391 bool operator==(list3 const & rhs) const
0392 {
0393 return
0394
0395 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0396 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0397 ref_compare( base_type::a3_, rhs.a3_, 0 );
0398 }
0399 };
0400
0401 template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
0402 {
0403 private:
0404
0405 typedef storage4< A1, A2, A3, A4 > base_type;
0406
0407 public:
0408
0409 list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
0410
0411 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0412 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0413 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0414 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0415
0416 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0417 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0418 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0419 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0420
0421 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0422
0423 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0424
0425 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0426
0427 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); }
0428
0429 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); }
0430
0431 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0432 {
0433 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
0434 }
0435
0436 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0437 {
0438 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
0439 }
0440
0441 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0442 {
0443 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
0444 }
0445
0446 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0447 {
0448 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
0449 }
0450
0451 template<class V> void accept(V & v) const
0452 {
0453 base_type::accept(v);
0454 }
0455
0456 bool operator==(list4 const & rhs) const
0457 {
0458 return
0459
0460 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0461 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0462 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0463 ref_compare( base_type::a4_, rhs.a4_, 0 );
0464 }
0465 };
0466
0467 template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
0468 {
0469 private:
0470
0471 typedef storage5< A1, A2, A3, A4, A5 > base_type;
0472
0473 public:
0474
0475 list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
0476
0477 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0478 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0479 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0480 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0481 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
0482
0483 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0484 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0485 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0486 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0487 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
0488
0489 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0490
0491 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0492
0493 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0494
0495 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); }
0496
0497 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); }
0498
0499 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0500 {
0501 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_]);
0502 }
0503
0504 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0505 {
0506 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_]);
0507 }
0508
0509 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0510 {
0511 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_]);
0512 }
0513
0514 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0515 {
0516 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_]);
0517 }
0518
0519 template<class V> void accept(V & v) const
0520 {
0521 base_type::accept(v);
0522 }
0523
0524 bool operator==(list5 const & rhs) const
0525 {
0526 return
0527
0528 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0529 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0530 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0531 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
0532 ref_compare( base_type::a5_, rhs.a5_, 0 );
0533 }
0534 };
0535
0536 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
0537 {
0538 private:
0539
0540 typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
0541
0542 public:
0543
0544 list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
0545
0546 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0547 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0548 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0549 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0550 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
0551 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
0552
0553 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0554 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0555 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0556 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0557 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
0558 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
0559
0560 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0561
0562 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0563
0564 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0565
0566 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); }
0567
0568 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); }
0569
0570 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0571 {
0572 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_]);
0573 }
0574
0575 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0576 {
0577 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_]);
0578 }
0579
0580 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0581 {
0582 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_]);
0583 }
0584
0585 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0586 {
0587 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_]);
0588 }
0589
0590 template<class V> void accept(V & v) const
0591 {
0592 base_type::accept(v);
0593 }
0594
0595 bool operator==(list6 const & rhs) const
0596 {
0597 return
0598
0599 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0600 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0601 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0602 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
0603 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
0604 ref_compare( base_type::a6_, rhs.a6_, 0 );
0605 }
0606 };
0607
0608 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 >
0609 {
0610 private:
0611
0612 typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
0613
0614 public:
0615
0616 list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
0617
0618 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0619 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0620 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0621 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0622 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
0623 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
0624 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
0625
0626 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0627 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0628 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0629 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0630 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
0631 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
0632 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
0633
0634 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0635
0636 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0637
0638 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0639
0640 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); }
0641
0642 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); }
0643
0644 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0645 {
0646 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_]);
0647 }
0648
0649 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0650 {
0651 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_]);
0652 }
0653
0654 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0655 {
0656 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_]);
0657 }
0658
0659 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0660 {
0661 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_]);
0662 }
0663
0664 template<class V> void accept(V & v) const
0665 {
0666 base_type::accept(v);
0667 }
0668
0669 bool operator==(list7 const & rhs) const
0670 {
0671 return
0672
0673 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0674 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0675 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0676 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
0677 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
0678 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
0679 ref_compare( base_type::a7_, rhs.a7_, 0 );
0680 }
0681 };
0682
0683 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 >
0684 {
0685 private:
0686
0687 typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
0688
0689 public:
0690
0691 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 ) {}
0692
0693 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0694 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0695 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0696 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0697 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
0698 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
0699 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
0700 A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
0701
0702 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0703 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0704 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0705 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0706 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
0707 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
0708 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
0709 A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
0710
0711 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0712
0713 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0714
0715 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0716
0717 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); }
0718
0719 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); }
0720
0721 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0722 {
0723 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_]);
0724 }
0725
0726 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0727 {
0728 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_]);
0729 }
0730
0731 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0732 {
0733 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_]);
0734 }
0735
0736 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0737 {
0738 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_]);
0739 }
0740
0741 template<class V> void accept(V & v) const
0742 {
0743 base_type::accept(v);
0744 }
0745
0746 bool operator==(list8 const & rhs) const
0747 {
0748 return
0749
0750 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0751 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0752 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0753 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
0754 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
0755 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
0756 ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
0757 ref_compare( base_type::a8_, rhs.a8_, 0 );
0758 }
0759 };
0760
0761 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 >
0762 {
0763 private:
0764
0765 typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
0766
0767 public:
0768
0769 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 ) {}
0770
0771 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
0772 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
0773 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
0774 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
0775 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
0776 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
0777 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
0778 A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
0779 A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
0780
0781 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
0782 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
0783 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
0784 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
0785 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
0786 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
0787 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
0788 A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
0789 A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; }
0790
0791 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
0792
0793 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
0794
0795 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0796
0797 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); }
0798
0799 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); }
0800
0801 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
0802 {
0803 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_]);
0804 }
0805
0806 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
0807 {
0808 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_]);
0809 }
0810
0811 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
0812 {
0813 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_]);
0814 }
0815
0816 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
0817 {
0818 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_]);
0819 }
0820
0821 template<class V> void accept(V & v) const
0822 {
0823 base_type::accept(v);
0824 }
0825
0826 bool operator==(list9 const & rhs) const
0827 {
0828 return
0829
0830 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
0831 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
0832 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
0833 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
0834 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
0835 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
0836 ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
0837 ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
0838 ref_compare( base_type::a9_, rhs.a9_, 0 );
0839 }
0840 };
0841
0842 #ifdef BOOST_MSVC
0843 #pragma warning(pop)
0844 #endif
0845
0846
0847
0848 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && BOOST_GCC < 40600)
0849
0850 template< class A1 > class rrlist1
0851 {
0852 private:
0853
0854 A1 & a1_;
0855
0856 public:
0857
0858 explicit rrlist1( A1 & a1 ): a1_( a1 ) {}
0859
0860 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
0861
0862 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
0863
0864 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
0865
0866 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
0867
0868 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0869
0870 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
0871 {
0872 rrlist1<A1&> a( a1_ );
0873 return b.eval( a );
0874 }
0875
0876 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
0877 {
0878 rrlist1<A1&> a( a1_ );
0879 return b.eval( a );
0880 }
0881 };
0882
0883 template< class A1, class A2 > class rrlist2
0884 {
0885 private:
0886
0887 A1 & a1_;
0888 A2 & a2_;
0889
0890 public:
0891
0892 rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {}
0893
0894 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
0895 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
0896
0897 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
0898 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
0899
0900 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
0901
0902 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
0903
0904 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0905
0906 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
0907 {
0908 rrlist2<A1&, A2&> a( a1_, a2_ );
0909 return b.eval( a );
0910 }
0911
0912 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
0913 {
0914 rrlist2<A1&, A2&> a( a1_, a2_ );
0915 return b.eval( a );
0916 }
0917 };
0918
0919 template< class A1, class A2, class A3 > class rrlist3
0920 {
0921 private:
0922
0923 A1 & a1_;
0924 A2 & a2_;
0925 A3 & a3_;
0926
0927 public:
0928
0929 rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {}
0930
0931 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
0932 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
0933 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
0934
0935 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
0936 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
0937 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
0938
0939 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
0940
0941 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
0942
0943 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0944
0945 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
0946 {
0947 rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
0948 return b.eval( a );
0949 }
0950
0951 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
0952 {
0953 rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
0954 return b.eval( a );
0955 }
0956 };
0957
0958 template< class A1, class A2, class A3, class A4 > class rrlist4
0959 {
0960 private:
0961
0962 A1 & a1_;
0963 A2 & a2_;
0964 A3 & a3_;
0965 A4 & a4_;
0966
0967 public:
0968
0969 rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {}
0970
0971 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
0972 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
0973 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
0974 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
0975
0976 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
0977 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
0978 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
0979 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
0980
0981 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
0982
0983 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
0984
0985 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
0986
0987 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
0988 {
0989 rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
0990 return b.eval( a );
0991 }
0992
0993 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
0994 {
0995 rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
0996 return b.eval( a );
0997 }
0998 };
0999
1000 template< class A1, class A2, class A3, class A4, class A5 > class rrlist5
1001 {
1002 private:
1003
1004 A1 & a1_;
1005 A2 & a2_;
1006 A3 & a3_;
1007 A4 & a4_;
1008 A5 & a5_;
1009
1010 public:
1011
1012 rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {}
1013
1014 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1015 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1016 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1017 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1018 A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1019
1020 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1021 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1022 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1023 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1024 A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1025
1026 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1027
1028 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1029
1030 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1031
1032 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1033 {
1034 rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
1035 return b.eval( a );
1036 }
1037
1038 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1039 {
1040 rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
1041 return b.eval( a );
1042 }
1043 };
1044
1045 template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6
1046 {
1047 private:
1048
1049 A1 & a1_;
1050 A2 & a2_;
1051 A3 & a3_;
1052 A4 & a4_;
1053 A5 & a5_;
1054 A6 & a6_;
1055
1056 public:
1057
1058 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 ) {}
1059
1060 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1061 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1062 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1063 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1064 A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1065 A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1066
1067 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1068 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1069 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1070 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1071 A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1072 A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1073
1074 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1075
1076 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1077
1078 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1079
1080 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1081 {
1082 rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
1083 return b.eval( a );
1084 }
1085
1086 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1087 {
1088 rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
1089 return b.eval( a );
1090 }
1091 };
1092
1093 template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7
1094 {
1095 private:
1096
1097 A1 & a1_;
1098 A2 & a2_;
1099 A3 & a3_;
1100 A4 & a4_;
1101 A5 & a5_;
1102 A6 & a6_;
1103 A7 & a7_;
1104
1105 public:
1106
1107 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 ) {}
1108
1109 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1110 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1111 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1112 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1113 A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1114 A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1115 A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1116
1117 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1118 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1119 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1120 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1121 A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1122 A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1123 A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1124
1125 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1126
1127 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1128
1129 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1130
1131 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1132 {
1133 rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
1134 return b.eval( a );
1135 }
1136
1137 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1138 {
1139 rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
1140 return b.eval( a );
1141 }
1142 };
1143
1144 template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8
1145 {
1146 private:
1147
1148 A1 & a1_;
1149 A2 & a2_;
1150 A3 & a3_;
1151 A4 & a4_;
1152 A5 & a5_;
1153 A6 & a6_;
1154 A7 & a7_;
1155 A8 & a8_;
1156
1157 public:
1158
1159 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 ) {}
1160
1161 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1162 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1163 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1164 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1165 A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1166 A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1167 A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1168 A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
1169
1170 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1171 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1172 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1173 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1174 A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1175 A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1176 A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1177 A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
1178
1179 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1180
1181 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1182
1183 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1184
1185 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1186 {
1187 rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
1188 return b.eval( a );
1189 }
1190
1191 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1192 {
1193 rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
1194 return b.eval( a );
1195 }
1196 };
1197
1198 template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9
1199 {
1200 private:
1201
1202 A1 & a1_;
1203 A2 & a2_;
1204 A3 & a3_;
1205 A4 & a4_;
1206 A5 & a5_;
1207 A6 & a6_;
1208 A7 & a7_;
1209 A8 & a8_;
1210 A9 & a9_;
1211
1212 public:
1213
1214 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 ) {}
1215
1216 A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
1217 A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
1218 A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
1219 A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
1220 A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
1221 A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
1222 A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
1223 A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
1224 A9 && operator[] (boost::arg<9>) const { return std::forward<A9>( a9_ ); }
1225
1226 A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
1227 A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
1228 A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
1229 A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
1230 A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
1231 A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
1232 A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
1233 A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
1234 A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward<A9>( a9_ ); }
1235
1236 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
1237
1238 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
1239
1240 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
1241
1242 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
1243 {
1244 rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
1245 return b.eval( a );
1246 }
1247
1248 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
1249 {
1250 rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
1251 return b.eval( a );
1252 }
1253 };
1254
1255 template<class R, class F, class L> class bind_t
1256 {
1257 private:
1258
1259 F f_;
1260 L l_;
1261
1262 public:
1263
1264 typedef typename result_traits<R, F>::type result_type;
1265 typedef bind_t this_type;
1266
1267 bind_t( F f, L const & l ): f_( f ), l_( l ) {}
1268
1269
1270
1271 result_type operator()()
1272 {
1273 list0 a;
1274 return l_( type<result_type>(), f_, a, 0 );
1275 }
1276
1277 result_type operator()() const
1278 {
1279 list0 a;
1280 return l_( type<result_type>(), f_, a, 0 );
1281 }
1282
1283 template<class A1> result_type operator()( A1 && a1 )
1284 {
1285 rrlist1< A1 > a( a1 );
1286 return l_( type<result_type>(), f_, a, 0 );
1287 }
1288
1289 template<class A1> result_type operator()( A1 && a1 ) const
1290 {
1291 rrlist1< A1 > a( a1 );
1292 return l_(type<result_type>(), f_, a, 0);
1293 }
1294
1295 template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 )
1296 {
1297 rrlist2< A1, A2 > a( a1, a2 );
1298 return l_( type<result_type>(), f_, a, 0 );
1299 }
1300
1301 template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 ) const
1302 {
1303 rrlist2< A1, A2 > a( a1, a2 );
1304 return l_( type<result_type>(), f_, a, 0 );
1305 }
1306
1307 template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 )
1308 {
1309 rrlist3< A1, A2, A3 > a( a1, a2, a3 );
1310 return l_( type<result_type>(), f_, a, 0 );
1311 }
1312
1313 template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const
1314 {
1315 rrlist3< A1, A2, A3 > a( a1, a2, a3 );
1316 return l_( type<result_type>(), f_, a, 0 );
1317 }
1318
1319 template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
1320 {
1321 rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
1322 return l_( type<result_type>(), f_, a, 0 );
1323 }
1324
1325 template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const
1326 {
1327 rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
1328 return l_( type<result_type>(), f_, a, 0 );
1329 }
1330
1331 template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
1332 {
1333 rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
1334 return l_( type<result_type>(), f_, a, 0 );
1335 }
1336
1337 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
1338 {
1339 rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
1340 return l_( type<result_type>(), f_, a, 0 );
1341 }
1342
1343 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 )
1344 {
1345 rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
1346 return l_( type<result_type>(), f_, a, 0 );
1347 }
1348
1349 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
1350 {
1351 rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
1352 return l_( type<result_type>(), f_, a, 0 );
1353 }
1354
1355 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 )
1356 {
1357 rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
1358 return l_( type<result_type>(), f_, a, 0 );
1359 }
1360
1361 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
1362 {
1363 rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
1364 return l_( type<result_type>(), f_, a, 0 );
1365 }
1366
1367 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 )
1368 {
1369 rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
1370 return l_( type<result_type>(), f_, a, 0 );
1371 }
1372
1373 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
1374 {
1375 rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
1376 return l_( type<result_type>(), f_, a, 0 );
1377 }
1378
1379 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 )
1380 {
1381 rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
1382 return l_( type<result_type>(), f_, a, 0 );
1383 }
1384
1385 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
1386 {
1387 rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
1388 return l_( type<result_type>(), f_, a, 0 );
1389 }
1390
1391
1392
1393 template<class A> result_type eval( A & a )
1394 {
1395 return l_( type<result_type>(), f_, a, 0 );
1396 }
1397
1398 template<class A> result_type eval( A & a ) const
1399 {
1400 return l_( type<result_type>(), f_, a, 0 );
1401 }
1402
1403 template<class V> void accept( V & v ) const
1404 {
1405 #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( BOOST_BORLANDC )
1406 using boost::visit_each;
1407 #endif
1408
1409 BOOST_BIND_VISIT_EACH( v, f_, 0 );
1410 l_.accept( v );
1411 }
1412
1413 bool compare( this_type const & rhs ) const
1414 {
1415 return ref_compare( f_, rhs.f_, 0 ) && l_ == rhs.l_;
1416 }
1417 };
1418
1419 #elif !defined( BOOST_NO_VOID_RETURNS )
1420
1421 template<class R, class F, class L> class bind_t
1422 {
1423 public:
1424
1425 typedef bind_t this_type;
1426
1427 bind_t(F f, L const & l): f_(f), l_(l) {}
1428
1429 #define BOOST_BIND_RETURN return
1430 #include <boost/bind/bind_template.hpp>
1431 #undef BOOST_BIND_RETURN
1432
1433 };
1434
1435 #else
1436
1437 template<class R> struct bind_t_generator
1438 {
1439
1440 template<class F, class L> class implementation
1441 {
1442 public:
1443
1444 typedef implementation this_type;
1445
1446 implementation(F f, L const & l): f_(f), l_(l) {}
1447
1448 #define BOOST_BIND_RETURN return
1449 #include <boost/bind/bind_template.hpp>
1450 #undef BOOST_BIND_RETURN
1451
1452 };
1453
1454 };
1455
1456 template<> struct bind_t_generator<void>
1457 {
1458
1459 template<class F, class L> class implementation
1460 {
1461 private:
1462
1463 typedef void R;
1464
1465 public:
1466
1467 typedef implementation this_type;
1468
1469 implementation(F f, L const & l): f_(f), l_(l) {}
1470
1471 #define BOOST_BIND_RETURN
1472 #include <boost/bind/bind_template.hpp>
1473 #undef BOOST_BIND_RETURN
1474
1475 };
1476
1477 };
1478
1479 template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
1480 {
1481 public:
1482
1483 bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
1484
1485 };
1486
1487 #endif
1488
1489
1490
1491 #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
1492
1493
1494
1495 # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1496
1497 template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
1498 {
1499 return a.compare(b);
1500 }
1501
1502 # else
1503
1504 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 )
1505 {
1506 return a.compare(b);
1507 }
1508
1509 # endif
1510
1511 #else
1512
1513
1514
1515 }
1516
1517 # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
1518
1519 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 )
1520 {
1521 return a.compare(b);
1522 }
1523
1524 # else
1525
1526 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 )
1527 {
1528 return a.compare(b);
1529 }
1530
1531 # endif
1532
1533 namespace _bi
1534 {
1535
1536 #endif
1537
1538
1539
1540 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
1541
1542 #if defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x582) )
1543
1544 template<class T> struct add_value
1545 {
1546 typedef _bi::value<T> type;
1547 };
1548
1549 #else
1550
1551 template< class T, int I > struct add_value_2
1552 {
1553 typedef boost::arg<I> type;
1554 };
1555
1556 template< class T > struct add_value_2< T, 0 >
1557 {
1558 typedef _bi::value< T > type;
1559 };
1560
1561 template<class T> struct add_value
1562 {
1563 typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
1564 };
1565
1566 #endif
1567
1568 template<class T> struct add_value< value<T> >
1569 {
1570 typedef _bi::value<T> type;
1571 };
1572
1573 template<class T> struct add_value< reference_wrapper<T> >
1574 {
1575 typedef reference_wrapper<T> type;
1576 };
1577
1578 template<int I> struct add_value< arg<I> >
1579 {
1580 typedef boost::arg<I> type;
1581 };
1582
1583 template<int I> struct add_value< arg<I> (*) () >
1584 {
1585 typedef boost::arg<I> (*type) ();
1586 };
1587
1588 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
1589 {
1590 typedef bind_t<R, F, L> type;
1591 };
1592
1593 #else
1594
1595 template<int I> struct _avt_0;
1596
1597 template<> struct _avt_0<1>
1598 {
1599 template<class T> struct inner
1600 {
1601 typedef T type;
1602 };
1603 };
1604
1605 template<> struct _avt_0<2>
1606 {
1607 template<class T> struct inner
1608 {
1609 typedef value<T> type;
1610 };
1611 };
1612
1613 typedef char (&_avt_r1) [1];
1614 typedef char (&_avt_r2) [2];
1615
1616 template<class T> _avt_r1 _avt_f(value<T>);
1617 template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
1618 template<int I> _avt_r1 _avt_f(arg<I>);
1619 template<int I> _avt_r1 _avt_f(arg<I> (*) ());
1620 template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
1621
1622 _avt_r2 _avt_f(...);
1623
1624 template<class T> struct add_value
1625 {
1626 static T t();
1627 typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
1628 };
1629
1630 #endif
1631
1632
1633
1634 template<class A1> struct list_av_1
1635 {
1636 typedef typename add_value<A1>::type B1;
1637 typedef list1<B1> type;
1638 };
1639
1640 template<class A1, class A2> struct list_av_2
1641 {
1642 typedef typename add_value<A1>::type B1;
1643 typedef typename add_value<A2>::type B2;
1644 typedef list2<B1, B2> type;
1645 };
1646
1647 template<class A1, class A2, class A3> struct list_av_3
1648 {
1649 typedef typename add_value<A1>::type B1;
1650 typedef typename add_value<A2>::type B2;
1651 typedef typename add_value<A3>::type B3;
1652 typedef list3<B1, B2, B3> type;
1653 };
1654
1655 template<class A1, class A2, class A3, class A4> struct list_av_4
1656 {
1657 typedef typename add_value<A1>::type B1;
1658 typedef typename add_value<A2>::type B2;
1659 typedef typename add_value<A3>::type B3;
1660 typedef typename add_value<A4>::type B4;
1661 typedef list4<B1, B2, B3, B4> type;
1662 };
1663
1664 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
1665 {
1666 typedef typename add_value<A1>::type B1;
1667 typedef typename add_value<A2>::type B2;
1668 typedef typename add_value<A3>::type B3;
1669 typedef typename add_value<A4>::type B4;
1670 typedef typename add_value<A5>::type B5;
1671 typedef list5<B1, B2, B3, B4, B5> type;
1672 };
1673
1674 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
1675 {
1676 typedef typename add_value<A1>::type B1;
1677 typedef typename add_value<A2>::type B2;
1678 typedef typename add_value<A3>::type B3;
1679 typedef typename add_value<A4>::type B4;
1680 typedef typename add_value<A5>::type B5;
1681 typedef typename add_value<A6>::type B6;
1682 typedef list6<B1, B2, B3, B4, B5, B6> type;
1683 };
1684
1685 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
1686 {
1687 typedef typename add_value<A1>::type B1;
1688 typedef typename add_value<A2>::type B2;
1689 typedef typename add_value<A3>::type B3;
1690 typedef typename add_value<A4>::type B4;
1691 typedef typename add_value<A5>::type B5;
1692 typedef typename add_value<A6>::type B6;
1693 typedef typename add_value<A7>::type B7;
1694 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
1695 };
1696
1697 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
1698 {
1699 typedef typename add_value<A1>::type B1;
1700 typedef typename add_value<A2>::type B2;
1701 typedef typename add_value<A3>::type B3;
1702 typedef typename add_value<A4>::type B4;
1703 typedef typename add_value<A5>::type B5;
1704 typedef typename add_value<A6>::type B6;
1705 typedef typename add_value<A7>::type B7;
1706 typedef typename add_value<A8>::type B8;
1707 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
1708 };
1709
1710 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
1711 {
1712 typedef typename add_value<A1>::type B1;
1713 typedef typename add_value<A2>::type B2;
1714 typedef typename add_value<A3>::type B3;
1715 typedef typename add_value<A4>::type B4;
1716 typedef typename add_value<A5>::type B5;
1717 typedef typename add_value<A6>::type B6;
1718 typedef typename add_value<A7>::type B7;
1719 typedef typename add_value<A8>::type B8;
1720 typedef typename add_value<A9>::type B9;
1721 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
1722 };
1723
1724
1725
1726 struct logical_not
1727 {
1728 template<class V> bool operator()(V const & v) const { return !v; }
1729 };
1730
1731 template<class R, class F, class L>
1732 bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
1733 operator! (bind_t<R, F, L> const & f)
1734 {
1735 typedef list1< bind_t<R, F, L> > list_type;
1736 return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
1737 }
1738
1739
1740
1741 #define BOOST_BIND_OPERATOR( op, name ) \
1742 \
1743 struct name \
1744 { \
1745 template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
1746 }; \
1747 \
1748 template<class R, class F, class L, class A2> \
1749 bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
1750 operator op (bind_t<R, F, L> const & f, A2 a2) \
1751 { \
1752 typedef typename add_value<A2>::type B2; \
1753 typedef list2< bind_t<R, F, L>, B2> list_type; \
1754 return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
1755 }
1756
1757 BOOST_BIND_OPERATOR( ==, equal )
1758 BOOST_BIND_OPERATOR( !=, not_equal )
1759
1760 BOOST_BIND_OPERATOR( <, less )
1761 BOOST_BIND_OPERATOR( <=, less_equal )
1762
1763 BOOST_BIND_OPERATOR( >, greater )
1764 BOOST_BIND_OPERATOR( >=, greater_equal )
1765
1766 BOOST_BIND_OPERATOR( &&, logical_and )
1767 BOOST_BIND_OPERATOR( ||, logical_or )
1768
1769 #undef BOOST_BIND_OPERATOR
1770
1771 #if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
1772
1773
1774
1775 #define BOOST_BIND_OPERATOR( op, name ) \
1776 \
1777 template<class R, class F, class L> \
1778 bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
1779 operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
1780 { \
1781 typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
1782 return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
1783 }
1784
1785 BOOST_BIND_OPERATOR( !=, not_equal )
1786 BOOST_BIND_OPERATOR( <=, less_equal )
1787 BOOST_BIND_OPERATOR( >, greater )
1788 BOOST_BIND_OPERATOR( >=, greater_equal )
1789
1790 #endif
1791
1792
1793
1794 #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( BOOST_BORLANDC ) \
1795 && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
1796
1797 template<class V, class T> void visit_each( V & v, value<T> const & t, int )
1798 {
1799 using boost::visit_each;
1800 BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
1801 }
1802
1803 template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
1804 {
1805 t.accept( v );
1806 }
1807
1808 #endif
1809
1810 }
1811
1812
1813
1814 #if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( BOOST_BORLANDC ) \
1815 || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
1816
1817 template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
1818 {
1819 BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
1820 }
1821
1822 template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
1823 {
1824 t.accept( v );
1825 }
1826
1827 #endif
1828
1829
1830
1831 template< class T > struct is_bind_expression
1832 {
1833 enum _vt { value = 0 };
1834 };
1835
1836 #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
1837
1838 template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
1839 {
1840 enum _vt { value = 1 };
1841 };
1842
1843 #endif
1844
1845
1846
1847 #ifndef BOOST_BIND
1848 #define BOOST_BIND bind
1849 #endif
1850
1851
1852
1853 template<class R, class F>
1854 _bi::bind_t<R, F, _bi::list0>
1855 BOOST_BIND(F f)
1856 {
1857 typedef _bi::list0 list_type;
1858 return _bi::bind_t<R, F, list_type> (f, list_type());
1859 }
1860
1861 template<class R, class F, class A1>
1862 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1863 BOOST_BIND(F f, A1 a1)
1864 {
1865 typedef typename _bi::list_av_1<A1>::type list_type;
1866 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1867 }
1868
1869 template<class R, class F, class A1, class A2>
1870 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1871 BOOST_BIND(F f, A1 a1, A2 a2)
1872 {
1873 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1874 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1875 }
1876
1877 template<class R, class F, class A1, class A2, class A3>
1878 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1879 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
1880 {
1881 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1882 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1883 }
1884
1885 template<class R, class F, class A1, class A2, class A3, class A4>
1886 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1887 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
1888 {
1889 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1890 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1891 }
1892
1893 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1894 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1895 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1896 {
1897 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1898 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1899 }
1900
1901 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1902 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1903 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1904 {
1905 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1906 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1907 }
1908
1909 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1910 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1911 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1912 {
1913 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1914 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1915 }
1916
1917 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
1918 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
1919 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
1920 {
1921 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
1922 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
1923 }
1924
1925 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
1926 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
1927 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
1928 {
1929 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
1930 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
1931 }
1932
1933
1934
1935 template<class R, class F>
1936 _bi::bind_t<R, F, _bi::list0>
1937 BOOST_BIND(boost::type<R>, F f)
1938 {
1939 typedef _bi::list0 list_type;
1940 return _bi::bind_t<R, F, list_type> (f, list_type());
1941 }
1942
1943 template<class R, class F, class A1>
1944 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
1945 BOOST_BIND(boost::type<R>, F f, A1 a1)
1946 {
1947 typedef typename _bi::list_av_1<A1>::type list_type;
1948 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
1949 }
1950
1951 template<class R, class F, class A1, class A2>
1952 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
1953 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
1954 {
1955 typedef typename _bi::list_av_2<A1, A2>::type list_type;
1956 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
1957 }
1958
1959 template<class R, class F, class A1, class A2, class A3>
1960 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
1961 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
1962 {
1963 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
1964 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
1965 }
1966
1967 template<class R, class F, class A1, class A2, class A3, class A4>
1968 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
1969 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
1970 {
1971 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1972 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1973 }
1974
1975 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1976 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
1977 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1978 {
1979 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1980 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1981 }
1982
1983 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
1984 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
1985 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
1986 {
1987 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
1988 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
1989 }
1990
1991 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
1992 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
1993 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
1994 {
1995 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
1996 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
1997 }
1998
1999 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
2000 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
2001 BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
2002 {
2003 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
2004 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
2005 }
2006
2007 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
2008 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
2009 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)
2010 {
2011 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
2012 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
2013 }
2014
2015 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
2016
2017
2018
2019 template<class F>
2020 _bi::bind_t<_bi::unspecified, F, _bi::list0>
2021 BOOST_BIND(F f)
2022 {
2023 typedef _bi::list0 list_type;
2024 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
2025 }
2026
2027 template<class F, class A1>
2028 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
2029 BOOST_BIND(F f, A1 a1)
2030 {
2031 typedef typename _bi::list_av_1<A1>::type list_type;
2032 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
2033 }
2034
2035 template<class F, class A1, class A2>
2036 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
2037 BOOST_BIND(F f, A1 a1, A2 a2)
2038 {
2039 typedef typename _bi::list_av_2<A1, A2>::type list_type;
2040 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
2041 }
2042
2043 template<class F, class A1, class A2, class A3>
2044 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
2045 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
2046 {
2047 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
2048 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
2049 }
2050
2051 template<class F, class A1, class A2, class A3, class A4>
2052 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
2053 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
2054 {
2055 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
2056 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
2057 }
2058
2059 template<class F, class A1, class A2, class A3, class A4, class A5>
2060 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
2061 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
2062 {
2063 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
2064 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
2065 }
2066
2067 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
2068 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
2069 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
2070 {
2071 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
2072 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
2073 }
2074
2075 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
2076 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
2077 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
2078 {
2079 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
2080 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
2081 }
2082
2083 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
2084 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
2085 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
2086 {
2087 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
2088 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
2089 }
2090
2091 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
2092 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
2093 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
2094 {
2095 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
2096 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
2097 }
2098
2099 #endif
2100
2101
2102
2103 #define BOOST_BIND_CC
2104 #define BOOST_BIND_ST
2105 #define BOOST_BIND_NOEXCEPT
2106
2107 #include <boost/bind/bind_cc.hpp>
2108
2109 # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2110 # undef BOOST_BIND_NOEXCEPT
2111 # define BOOST_BIND_NOEXCEPT noexcept
2112 # include <boost/bind/bind_cc.hpp>
2113 # endif
2114
2115 #undef BOOST_BIND_CC
2116 #undef BOOST_BIND_ST
2117 #undef BOOST_BIND_NOEXCEPT
2118
2119 #if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
2120
2121 #define BOOST_BIND_CC __stdcall
2122 #define BOOST_BIND_ST
2123 #define BOOST_BIND_NOEXCEPT
2124
2125 #include <boost/bind/bind_cc.hpp>
2126
2127 #undef BOOST_BIND_CC
2128 #undef BOOST_BIND_ST
2129 #undef BOOST_BIND_NOEXCEPT
2130
2131 #endif
2132
2133 #if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
2134
2135 #define BOOST_BIND_CC __fastcall
2136 #define BOOST_BIND_ST
2137 #define BOOST_BIND_NOEXCEPT
2138
2139 #include <boost/bind/bind_cc.hpp>
2140
2141 #undef BOOST_BIND_CC
2142 #undef BOOST_BIND_ST
2143 #undef BOOST_BIND_NOEXCEPT
2144
2145 #endif
2146
2147 #ifdef BOOST_BIND_ENABLE_PASCAL
2148
2149 #define BOOST_BIND_ST pascal
2150 #define BOOST_BIND_CC
2151 #define BOOST_BIND_NOEXCEPT
2152
2153 #include <boost/bind/bind_cc.hpp>
2154
2155 #undef BOOST_BIND_ST
2156 #undef BOOST_BIND_CC
2157 #undef BOOST_BIND_NOEXCEPT
2158
2159 #endif
2160
2161
2162
2163 #define BOOST_BIND_MF_NAME(X) X
2164 #define BOOST_BIND_MF_CC
2165 #define BOOST_BIND_MF_NOEXCEPT
2166
2167 #include <boost/bind/bind_mf_cc.hpp>
2168 #include <boost/bind/bind_mf2_cc.hpp>
2169
2170 # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2171 # undef BOOST_BIND_MF_NOEXCEPT
2172 # define BOOST_BIND_MF_NOEXCEPT noexcept
2173 # include <boost/bind/bind_mf_cc.hpp>
2174 # include <boost/bind/bind_mf2_cc.hpp>
2175 # endif
2176
2177 #undef BOOST_BIND_MF_NAME
2178 #undef BOOST_BIND_MF_CC
2179 #undef BOOST_BIND_MF_NOEXCEPT
2180
2181 #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
2182
2183 #define BOOST_BIND_MF_NAME(X) X##_cdecl
2184 #define BOOST_BIND_MF_CC __cdecl
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 #undef BOOST_BIND_MF_NAME
2191 #undef BOOST_BIND_MF_CC
2192 #undef BOOST_BIND_MF_NOEXCEPT
2193
2194 #endif
2195
2196 #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
2197
2198 #define BOOST_BIND_MF_NAME(X) X##_stdcall
2199 #define BOOST_BIND_MF_CC __stdcall
2200 #define BOOST_BIND_MF_NOEXCEPT
2201
2202 #include <boost/bind/bind_mf_cc.hpp>
2203 #include <boost/bind/bind_mf2_cc.hpp>
2204
2205 #undef BOOST_BIND_MF_NAME
2206 #undef BOOST_BIND_MF_CC
2207 #undef BOOST_BIND_MF_NOEXCEPT
2208
2209 #endif
2210
2211 #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
2212
2213 #define BOOST_BIND_MF_NAME(X) X##_fastcall
2214 #define BOOST_BIND_MF_CC __fastcall
2215 #define BOOST_BIND_MF_NOEXCEPT
2216
2217 #include <boost/bind/bind_mf_cc.hpp>
2218 #include <boost/bind/bind_mf2_cc.hpp>
2219
2220 #undef BOOST_BIND_MF_NAME
2221 #undef BOOST_BIND_MF_CC
2222 #undef BOOST_BIND_MF_NOEXCEPT
2223
2224 #endif
2225
2226
2227
2228 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
2229 || ( defined(BOOST_BORLANDC) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT( 0x620 ) ) )
2230
2231 template<class R, class T, class A1>
2232 _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
2233 BOOST_BIND(R T::*f, A1 a1)
2234 {
2235 typedef _mfi::dm<R, T> F;
2236 typedef typename _bi::list_av_1<A1>::type list_type;
2237 return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
2238 }
2239
2240 #else
2241
2242 namespace _bi
2243 {
2244
2245 template< class Pm, int I > struct add_cref;
2246
2247 template< class M, class T > struct add_cref< M T::*, 0 >
2248 {
2249 typedef M type;
2250 };
2251
2252 template< class M, class T > struct add_cref< M T::*, 1 >
2253 {
2254 #ifdef BOOST_MSVC
2255 #pragma warning(push)
2256 #pragma warning(disable:4180)
2257 #endif
2258 typedef M const & type;
2259 #ifdef BOOST_MSVC
2260 #pragma warning(pop)
2261 #endif
2262 };
2263
2264 template< class R, class T > struct add_cref< R (T::*) (), 1 >
2265 {
2266 typedef void type;
2267 };
2268
2269 #if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION
2270
2271 template< class R, class T > struct add_cref< R (T::*) () const, 1 >
2272 {
2273 typedef void type;
2274 };
2275
2276 #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
2277
2278 template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 >
2279 {
2280 typedef void type;
2281 };
2282
2283 #endif
2284
2285 #endif
2286
2287 template<class R> struct isref
2288 {
2289 enum value_type { value = 0 };
2290 };
2291
2292 template<class R> struct isref< R& >
2293 {
2294 enum value_type { value = 1 };
2295 };
2296
2297 template<class R> struct isref< R* >
2298 {
2299 enum value_type { value = 1 };
2300 };
2301
2302 template<class Pm, class A1> struct dm_result
2303 {
2304 typedef typename add_cref< Pm, 1 >::type type;
2305 };
2306
2307 template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
2308 {
2309 typedef typename bind_t<R, F, L>::result_type result_type;
2310 typedef typename add_cref< Pm, isref< result_type >::value >::type type;
2311 };
2312
2313 }
2314
2315 template< class A1, class M, class T >
2316
2317 _bi::bind_t<
2318 typename _bi::dm_result< M T::*, A1 >::type,
2319 _mfi::dm<M, T>,
2320 typename _bi::list_av_1<A1>::type
2321 >
2322
2323 BOOST_BIND( M T::*f, A1 a1 )
2324 {
2325 typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
2326 typedef _mfi::dm<M, T> F;
2327 typedef typename _bi::list_av_1<A1>::type list_type;
2328 return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
2329 }
2330
2331 #endif
2332
2333 }
2334
2335 #ifndef BOOST_BIND_NO_PLACEHOLDERS
2336
2337 # include <boost/bind/placeholders.hpp>
2338
2339 #endif
2340
2341 #ifdef BOOST_MSVC
2342 # pragma warning(default: 4512)
2343 # pragma warning(pop)
2344 #endif
2345
2346 #endif