File indexing completed on 2025-01-18 09:41:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 namespace boost { namespace mpl {
0014
0015 namespace aux {
0016 template< bool >
0017 struct resolve_arg_impl
0018 {
0019 template<
0020 typename T, typename U1, typename U2, typename U3
0021 , typename U4, typename U5
0022 >
0023 struct result_
0024 {
0025 typedef T type;
0026 };
0027 };
0028
0029 template<>
0030 struct resolve_arg_impl<true>
0031 {
0032 template<
0033 typename T, typename U1, typename U2, typename U3
0034 , typename U4, typename U5
0035 >
0036 struct result_
0037 {
0038 typedef typename apply_wrap5<
0039 T
0040 , U1, U2, U3, U4, U5
0041 >::type type;
0042 };
0043 };
0044
0045 template< typename T > struct is_bind_template;
0046
0047 template<
0048 typename T, typename U1, typename U2, typename U3, typename U4
0049 , typename U5
0050 >
0051 struct resolve_bind_arg
0052 : resolve_arg_impl< is_bind_template<T>::value >
0053 ::template result_< T,U1,U2,U3,U4,U5 >
0054 {
0055 };
0056
0057 template< typename T >
0058 struct replace_unnamed_arg_impl
0059 {
0060 template< typename Arg > struct result_
0061 {
0062 typedef Arg next;
0063 typedef T type;
0064 };
0065 };
0066
0067 template<>
0068 struct replace_unnamed_arg_impl< arg< -1 > >
0069 {
0070 template< typename Arg > struct result_
0071 {
0072 typedef typename next<Arg>::type next;
0073 typedef Arg type;
0074 };
0075 };
0076
0077 template< typename T, typename Arg >
0078 struct replace_unnamed_arg
0079 : replace_unnamed_arg_impl<T>::template result_<Arg>
0080 {
0081 };
0082
0083 template< int arity_ > struct bind_chooser;
0084
0085 aux::no_tag is_bind_helper(...);
0086 template< typename T > aux::no_tag is_bind_helper(protect<T>*);
0087
0088 template<
0089 typename F, typename T1, typename T2, typename T3, typename T4
0090 , typename T5
0091 >
0092 aux::yes_tag is_bind_helper(bind< F,T1,T2,T3,T4,T5 >*);
0093
0094 template< int N >
0095 aux::yes_tag is_bind_helper(arg<N>*);
0096
0097 template< bool is_ref_ = true >
0098 struct is_bind_template_impl
0099 {
0100 template< typename T > struct result_
0101 {
0102 BOOST_STATIC_CONSTANT(bool, value = false);
0103 };
0104 };
0105
0106 template<>
0107 struct is_bind_template_impl<false>
0108 {
0109 template< typename T > struct result_
0110 {
0111 BOOST_STATIC_CONSTANT(bool, value =
0112 sizeof(aux::is_bind_helper(static_cast<T*>(0)))
0113 == sizeof(aux::yes_tag)
0114 );
0115 };
0116 };
0117
0118 template< typename T > struct is_bind_template
0119 : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
0120 ::template result_<T>
0121 {
0122 };
0123
0124 }
0125
0126 template<
0127 typename F
0128 >
0129 struct bind0
0130 {
0131 template<
0132 typename U1 = na, typename U2 = na, typename U3 = na
0133 , typename U4 = na, typename U5 = na
0134 >
0135 struct apply
0136 {
0137 private:
0138 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0139 typedef typename r0::type a0;
0140 typedef typename r0::next n1;
0141 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0142
0143 public:
0144 typedef typename apply_wrap0<
0145 f_
0146 >::type type;
0147
0148 };
0149 };
0150
0151 namespace aux {
0152
0153 template<
0154 typename F
0155 >
0156 aux::yes_tag
0157 is_bind_helper(bind0<F>*);
0158
0159 }
0160
0161 BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
0162 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
0163
0164 namespace aux {
0165
0166 template<>
0167 struct bind_chooser<0>
0168 {
0169 template<
0170 typename F, typename T1, typename T2, typename T3, typename T4
0171 , typename T5
0172 >
0173 struct result_
0174 {
0175 typedef bind0<F> type;
0176 };
0177 };
0178
0179 }
0180
0181 template<
0182 typename F, typename T1
0183 >
0184 struct bind1
0185 {
0186 template<
0187 typename U1 = na, typename U2 = na, typename U3 = na
0188 , typename U4 = na, typename U5 = na
0189 >
0190 struct apply
0191 {
0192 private:
0193 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0194 typedef typename r0::type a0;
0195 typedef typename r0::next n1;
0196 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0197
0198 typedef aux::replace_unnamed_arg< T1,n1 > r1;
0199 typedef typename r1::type a1;
0200 typedef typename r1::next n2;
0201 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
0202
0203 public:
0204 typedef typename apply_wrap1<
0205 f_
0206 , typename t1::type
0207 >::type type;
0208
0209 };
0210 };
0211
0212 namespace aux {
0213
0214 template<
0215 typename F, typename T1
0216 >
0217 aux::yes_tag
0218 is_bind_helper(bind1< F,T1 >*);
0219
0220 }
0221
0222 BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
0223 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
0224
0225 namespace aux {
0226
0227 template<>
0228 struct bind_chooser<1>
0229 {
0230 template<
0231 typename F, typename T1, typename T2, typename T3, typename T4
0232 , typename T5
0233 >
0234 struct result_
0235 {
0236 typedef bind1< F,T1 > type;
0237 };
0238 };
0239
0240 }
0241
0242 template<
0243 typename F, typename T1, typename T2
0244 >
0245 struct bind2
0246 {
0247 template<
0248 typename U1 = na, typename U2 = na, typename U3 = na
0249 , typename U4 = na, typename U5 = na
0250 >
0251 struct apply
0252 {
0253 private:
0254 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0255 typedef typename r0::type a0;
0256 typedef typename r0::next n1;
0257 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0258
0259 typedef aux::replace_unnamed_arg< T1,n1 > r1;
0260 typedef typename r1::type a1;
0261 typedef typename r1::next n2;
0262 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
0263
0264 typedef aux::replace_unnamed_arg< T2,n2 > r2;
0265 typedef typename r2::type a2;
0266 typedef typename r2::next n3;
0267 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
0268
0269 public:
0270 typedef typename apply_wrap2<
0271 f_
0272 , typename t1::type, typename t2::type
0273 >::type type;
0274
0275 };
0276 };
0277
0278 namespace aux {
0279
0280 template<
0281 typename F, typename T1, typename T2
0282 >
0283 aux::yes_tag
0284 is_bind_helper(bind2< F,T1,T2 >*);
0285
0286 }
0287
0288 BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
0289 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
0290
0291 namespace aux {
0292
0293 template<>
0294 struct bind_chooser<2>
0295 {
0296 template<
0297 typename F, typename T1, typename T2, typename T3, typename T4
0298 , typename T5
0299 >
0300 struct result_
0301 {
0302 typedef bind2< F,T1,T2 > type;
0303 };
0304 };
0305
0306 }
0307
0308 template<
0309 typename F, typename T1, typename T2, typename T3
0310 >
0311 struct bind3
0312 {
0313 template<
0314 typename U1 = na, typename U2 = na, typename U3 = na
0315 , typename U4 = na, typename U5 = na
0316 >
0317 struct apply
0318 {
0319 private:
0320 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0321 typedef typename r0::type a0;
0322 typedef typename r0::next n1;
0323 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0324
0325 typedef aux::replace_unnamed_arg< T1,n1 > r1;
0326 typedef typename r1::type a1;
0327 typedef typename r1::next n2;
0328 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
0329
0330 typedef aux::replace_unnamed_arg< T2,n2 > r2;
0331 typedef typename r2::type a2;
0332 typedef typename r2::next n3;
0333 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
0334
0335 typedef aux::replace_unnamed_arg< T3,n3 > r3;
0336 typedef typename r3::type a3;
0337 typedef typename r3::next n4;
0338 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
0339
0340 public:
0341 typedef typename apply_wrap3<
0342 f_
0343 , typename t1::type, typename t2::type, typename t3::type
0344 >::type type;
0345
0346 };
0347 };
0348
0349 namespace aux {
0350
0351 template<
0352 typename F, typename T1, typename T2, typename T3
0353 >
0354 aux::yes_tag
0355 is_bind_helper(bind3< F,T1,T2,T3 >*);
0356
0357 }
0358
0359 BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
0360 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
0361
0362 namespace aux {
0363
0364 template<>
0365 struct bind_chooser<3>
0366 {
0367 template<
0368 typename F, typename T1, typename T2, typename T3, typename T4
0369 , typename T5
0370 >
0371 struct result_
0372 {
0373 typedef bind3< F,T1,T2,T3 > type;
0374 };
0375 };
0376
0377 }
0378
0379 template<
0380 typename F, typename T1, typename T2, typename T3, typename T4
0381 >
0382 struct bind4
0383 {
0384 template<
0385 typename U1 = na, typename U2 = na, typename U3 = na
0386 , typename U4 = na, typename U5 = na
0387 >
0388 struct apply
0389 {
0390 private:
0391 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0392 typedef typename r0::type a0;
0393 typedef typename r0::next n1;
0394 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0395
0396 typedef aux::replace_unnamed_arg< T1,n1 > r1;
0397 typedef typename r1::type a1;
0398 typedef typename r1::next n2;
0399 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
0400
0401 typedef aux::replace_unnamed_arg< T2,n2 > r2;
0402 typedef typename r2::type a2;
0403 typedef typename r2::next n3;
0404 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
0405
0406 typedef aux::replace_unnamed_arg< T3,n3 > r3;
0407 typedef typename r3::type a3;
0408 typedef typename r3::next n4;
0409 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
0410
0411 typedef aux::replace_unnamed_arg< T4,n4 > r4;
0412 typedef typename r4::type a4;
0413 typedef typename r4::next n5;
0414 typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
0415
0416 public:
0417 typedef typename apply_wrap4<
0418 f_
0419 , typename t1::type, typename t2::type, typename t3::type
0420 , typename t4::type
0421 >::type type;
0422
0423 };
0424 };
0425
0426 namespace aux {
0427
0428 template<
0429 typename F, typename T1, typename T2, typename T3, typename T4
0430 >
0431 aux::yes_tag
0432 is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
0433
0434 }
0435
0436 BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
0437 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
0438
0439 namespace aux {
0440
0441 template<>
0442 struct bind_chooser<4>
0443 {
0444 template<
0445 typename F, typename T1, typename T2, typename T3, typename T4
0446 , typename T5
0447 >
0448 struct result_
0449 {
0450 typedef bind4< F,T1,T2,T3,T4 > type;
0451 };
0452 };
0453
0454 }
0455
0456 template<
0457 typename F, typename T1, typename T2, typename T3, typename T4
0458 , typename T5
0459 >
0460 struct bind5
0461 {
0462 template<
0463 typename U1 = na, typename U2 = na, typename U3 = na
0464 , typename U4 = na, typename U5 = na
0465 >
0466 struct apply
0467 {
0468 private:
0469 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
0470 typedef typename r0::type a0;
0471 typedef typename r0::next n1;
0472 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
0473
0474 typedef aux::replace_unnamed_arg< T1,n1 > r1;
0475 typedef typename r1::type a1;
0476 typedef typename r1::next n2;
0477 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
0478
0479 typedef aux::replace_unnamed_arg< T2,n2 > r2;
0480 typedef typename r2::type a2;
0481 typedef typename r2::next n3;
0482 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
0483
0484 typedef aux::replace_unnamed_arg< T3,n3 > r3;
0485 typedef typename r3::type a3;
0486 typedef typename r3::next n4;
0487 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
0488
0489 typedef aux::replace_unnamed_arg< T4,n4 > r4;
0490 typedef typename r4::type a4;
0491 typedef typename r4::next n5;
0492 typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
0493
0494 typedef aux::replace_unnamed_arg< T5,n5 > r5;
0495 typedef typename r5::type a5;
0496 typedef typename r5::next n6;
0497 typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
0498
0499 public:
0500 typedef typename apply_wrap5<
0501 f_
0502 , typename t1::type, typename t2::type, typename t3::type
0503 , typename t4::type, typename t5::type
0504 >::type type;
0505
0506 };
0507 };
0508
0509 namespace aux {
0510
0511 template<
0512 typename F, typename T1, typename T2, typename T3, typename T4
0513 , typename T5
0514 >
0515 aux::yes_tag
0516 is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
0517
0518 }
0519
0520 BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
0521 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
0522
0523 namespace aux {
0524
0525 template<>
0526 struct bind_chooser<5>
0527 {
0528 template<
0529 typename F, typename T1, typename T2, typename T3, typename T4
0530 , typename T5
0531 >
0532 struct result_
0533 {
0534 typedef bind5< F,T1,T2,T3,T4,T5 > type;
0535 };
0536 };
0537
0538 }
0539
0540 namespace aux {
0541
0542 template< typename T >
0543 struct is_bind_arg
0544 {
0545 BOOST_STATIC_CONSTANT(bool, value = true);
0546 };
0547
0548 template<>
0549 struct is_bind_arg<na>
0550 {
0551 BOOST_STATIC_CONSTANT(bool, value = false);
0552 };
0553
0554 template<
0555 typename T1, typename T2, typename T3, typename T4, typename T5
0556 >
0557 struct bind_count_args
0558 {
0559 BOOST_STATIC_CONSTANT(int, value =
0560 is_bind_arg<T1>::value + is_bind_arg<T2>::value
0561 + is_bind_arg<T3>::value + is_bind_arg<T4>::value
0562 + is_bind_arg<T5>::value
0563 );
0564
0565 };
0566
0567 }
0568
0569 template<
0570 typename F, typename T1, typename T2, typename T3, typename T4
0571 , typename T5
0572 >
0573 struct bind
0574 : aux::bind_chooser<
0575 aux::bind_count_args< T1,T2,T3,T4,T5 >::value
0576 >::template result_< F,T1,T2,T3,T4,T5 >::type
0577 {
0578 };
0579
0580 BOOST_MPL_AUX_ARITY_SPEC(
0581 6
0582 , bind
0583 )
0584
0585 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
0586 6
0587 , bind
0588 )
0589 }}
0590