File indexing completed on 2025-01-18 09:41:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 namespace boost { namespace mpl {
0013
0014 namespace aux {
0015
0016 template<
0017 bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false
0018 , bool C5 = false
0019 >
0020 struct lambda_or
0021 : true_
0022 {
0023 };
0024
0025 template<>
0026 struct lambda_or< false,false,false,false,false >
0027 : false_
0028 {
0029 };
0030
0031 }
0032
0033 template<
0034 typename T
0035 , typename Tag
0036
0037 >
0038 struct lambda
0039 {
0040 typedef false_ is_le;
0041 typedef T result_;
0042 typedef T type;
0043 };
0044
0045 template<
0046 typename T
0047 >
0048 struct is_lambda_expression
0049 : lambda<T>::is_le
0050 {
0051 };
0052
0053 template< int N, typename Tag >
0054 struct lambda< arg<N>, Tag >
0055 {
0056 typedef true_ is_le;
0057 typedef mpl::arg<N> result_;
0058 typedef mpl::protect<result_> type;
0059 };
0060
0061 template<
0062 typename F
0063 , typename Tag
0064 >
0065 struct lambda<
0066 bind0<F>
0067 , Tag
0068
0069 >
0070 {
0071 typedef false_ is_le;
0072 typedef bind0<
0073 F
0074 > result_;
0075
0076 typedef result_ type;
0077 };
0078
0079 namespace aux {
0080
0081 template<
0082 typename IsLE, typename Tag
0083 , template< typename P1 > class F
0084 , typename L1
0085 >
0086 struct le_result1
0087 {
0088 typedef F<
0089 typename L1::type
0090 > result_;
0091
0092 typedef result_ type;
0093 };
0094
0095 template<
0096 typename Tag
0097 , template< typename P1 > class F
0098 , typename L1
0099 >
0100 struct le_result1< true_,Tag,F,L1 >
0101 {
0102 typedef bind1<
0103 quote1< F,Tag >
0104 , typename L1::result_
0105 > result_;
0106
0107 typedef mpl::protect<result_> type;
0108 };
0109
0110 }
0111
0112 template<
0113 template< typename P1 > class F
0114 , typename T1
0115 , typename Tag
0116 >
0117 struct lambda<
0118 F<T1>
0119 , Tag
0120
0121 >
0122 {
0123 typedef lambda< T1,Tag > l1;
0124 typedef typename l1::is_le is_le1;
0125 typedef typename aux::lambda_or<
0126 is_le1::value
0127 >::type is_le;
0128
0129 typedef aux::le_result1<
0130 is_le, Tag, F, l1
0131 > le_result_;
0132
0133 typedef typename le_result_::result_ result_;
0134 typedef typename le_result_::type type;
0135 };
0136
0137 template<
0138 typename F, typename T1
0139 , typename Tag
0140 >
0141 struct lambda<
0142 bind1< F,T1 >
0143 , Tag
0144
0145 >
0146 {
0147 typedef false_ is_le;
0148 typedef bind1<
0149 F
0150 , T1
0151 > result_;
0152
0153 typedef result_ type;
0154 };
0155
0156 namespace aux {
0157
0158 template<
0159 typename IsLE, typename Tag
0160 , template< typename P1, typename P2 > class F
0161 , typename L1, typename L2
0162 >
0163 struct le_result2
0164 {
0165 typedef F<
0166 typename L1::type, typename L2::type
0167 > result_;
0168
0169 typedef result_ type;
0170 };
0171
0172 template<
0173 typename Tag
0174 , template< typename P1, typename P2 > class F
0175 , typename L1, typename L2
0176 >
0177 struct le_result2< true_,Tag,F,L1,L2 >
0178 {
0179 typedef bind2<
0180 quote2< F,Tag >
0181 , typename L1::result_, typename L2::result_
0182 > result_;
0183
0184 typedef mpl::protect<result_> type;
0185 };
0186
0187 }
0188
0189 template<
0190 template< typename P1, typename P2 > class F
0191 , typename T1, typename T2
0192 , typename Tag
0193 >
0194 struct lambda<
0195 F< T1,T2 >
0196 , Tag
0197
0198 >
0199 {
0200 typedef lambda< T1,Tag > l1;
0201 typedef lambda< T2,Tag > l2;
0202
0203 typedef typename l1::is_le is_le1;
0204 typedef typename l2::is_le is_le2;
0205
0206
0207 typedef typename aux::lambda_or<
0208 is_le1::value, is_le2::value
0209 >::type is_le;
0210
0211 typedef aux::le_result2<
0212 is_le, Tag, F, l1, l2
0213 > le_result_;
0214
0215 typedef typename le_result_::result_ result_;
0216 typedef typename le_result_::type type;
0217 };
0218
0219 template<
0220 typename F, typename T1, typename T2
0221 , typename Tag
0222 >
0223 struct lambda<
0224 bind2< F,T1,T2 >
0225 , Tag
0226
0227 >
0228 {
0229 typedef false_ is_le;
0230 typedef bind2<
0231 F
0232 , T1, T2
0233 > result_;
0234
0235 typedef result_ type;
0236 };
0237
0238 namespace aux {
0239
0240 template<
0241 typename IsLE, typename Tag
0242 , template< typename P1, typename P2, typename P3 > class F
0243 , typename L1, typename L2, typename L3
0244 >
0245 struct le_result3
0246 {
0247 typedef F<
0248 typename L1::type, typename L2::type, typename L3::type
0249 > result_;
0250
0251 typedef result_ type;
0252 };
0253
0254 template<
0255 typename Tag
0256 , template< typename P1, typename P2, typename P3 > class F
0257 , typename L1, typename L2, typename L3
0258 >
0259 struct le_result3< true_,Tag,F,L1,L2,L3 >
0260 {
0261 typedef bind3<
0262 quote3< F,Tag >
0263 , typename L1::result_, typename L2::result_, typename L3::result_
0264 > result_;
0265
0266 typedef mpl::protect<result_> type;
0267 };
0268
0269 }
0270
0271 template<
0272 template< typename P1, typename P2, typename P3 > class F
0273 , typename T1, typename T2, typename T3
0274 , typename Tag
0275 >
0276 struct lambda<
0277 F< T1,T2,T3 >
0278 , Tag
0279
0280 >
0281 {
0282 typedef lambda< T1,Tag > l1;
0283 typedef lambda< T2,Tag > l2;
0284 typedef lambda< T3,Tag > l3;
0285
0286 typedef typename l1::is_le is_le1;
0287 typedef typename l2::is_le is_le2;
0288 typedef typename l3::is_le is_le3;
0289
0290
0291 typedef typename aux::lambda_or<
0292 is_le1::value, is_le2::value, is_le3::value
0293 >::type is_le;
0294
0295 typedef aux::le_result3<
0296 is_le, Tag, F, l1, l2, l3
0297 > le_result_;
0298
0299 typedef typename le_result_::result_ result_;
0300 typedef typename le_result_::type type;
0301 };
0302
0303 template<
0304 typename F, typename T1, typename T2, typename T3
0305 , typename Tag
0306 >
0307 struct lambda<
0308 bind3< F,T1,T2,T3 >
0309 , Tag
0310
0311 >
0312 {
0313 typedef false_ is_le;
0314 typedef bind3<
0315 F
0316 , T1, T2, T3
0317 > result_;
0318
0319 typedef result_ type;
0320 };
0321
0322 namespace aux {
0323
0324 template<
0325 typename IsLE, typename Tag
0326 , template< typename P1, typename P2, typename P3, typename P4 > class F
0327 , typename L1, typename L2, typename L3, typename L4
0328 >
0329 struct le_result4
0330 {
0331 typedef F<
0332 typename L1::type, typename L2::type, typename L3::type
0333 , typename L4::type
0334 > result_;
0335
0336 typedef result_ type;
0337 };
0338
0339 template<
0340 typename Tag
0341 , template< typename P1, typename P2, typename P3, typename P4 > class F
0342 , typename L1, typename L2, typename L3, typename L4
0343 >
0344 struct le_result4< true_,Tag,F,L1,L2,L3,L4 >
0345 {
0346 typedef bind4<
0347 quote4< F,Tag >
0348 , typename L1::result_, typename L2::result_, typename L3::result_
0349 , typename L4::result_
0350 > result_;
0351
0352 typedef mpl::protect<result_> type;
0353 };
0354
0355 }
0356
0357 template<
0358 template< typename P1, typename P2, typename P3, typename P4 > class F
0359 , typename T1, typename T2, typename T3, typename T4
0360 , typename Tag
0361 >
0362 struct lambda<
0363 F< T1,T2,T3,T4 >
0364 , Tag
0365
0366 >
0367 {
0368 typedef lambda< T1,Tag > l1;
0369 typedef lambda< T2,Tag > l2;
0370 typedef lambda< T3,Tag > l3;
0371 typedef lambda< T4,Tag > l4;
0372
0373 typedef typename l1::is_le is_le1;
0374 typedef typename l2::is_le is_le2;
0375 typedef typename l3::is_le is_le3;
0376 typedef typename l4::is_le is_le4;
0377
0378
0379 typedef typename aux::lambda_or<
0380 is_le1::value, is_le2::value, is_le3::value, is_le4::value
0381 >::type is_le;
0382
0383 typedef aux::le_result4<
0384 is_le, Tag, F, l1, l2, l3, l4
0385 > le_result_;
0386
0387 typedef typename le_result_::result_ result_;
0388 typedef typename le_result_::type type;
0389 };
0390
0391 template<
0392 typename F, typename T1, typename T2, typename T3, typename T4
0393 , typename Tag
0394 >
0395 struct lambda<
0396 bind4< F,T1,T2,T3,T4 >
0397 , Tag
0398
0399 >
0400 {
0401 typedef false_ is_le;
0402 typedef bind4<
0403 F
0404 , T1, T2, T3, T4
0405 > result_;
0406
0407 typedef result_ type;
0408 };
0409
0410 namespace aux {
0411
0412 template<
0413 typename IsLE, typename Tag
0414 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
0415 , typename L1, typename L2, typename L3, typename L4, typename L5
0416 >
0417 struct le_result5
0418 {
0419 typedef F<
0420 typename L1::type, typename L2::type, typename L3::type
0421 , typename L4::type, typename L5::type
0422 > result_;
0423
0424 typedef result_ type;
0425 };
0426
0427 template<
0428 typename Tag
0429 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
0430 , typename L1, typename L2, typename L3, typename L4, typename L5
0431 >
0432 struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >
0433 {
0434 typedef bind5<
0435 quote5< F,Tag >
0436 , typename L1::result_, typename L2::result_, typename L3::result_
0437 , typename L4::result_, typename L5::result_
0438 > result_;
0439
0440 typedef mpl::protect<result_> type;
0441 };
0442
0443 }
0444
0445 template<
0446 template<
0447 typename P1, typename P2, typename P3, typename P4
0448 , typename P5
0449 >
0450 class F
0451 , typename T1, typename T2, typename T3, typename T4, typename T5
0452 , typename Tag
0453 >
0454 struct lambda<
0455 F< T1,T2,T3,T4,T5 >
0456 , Tag
0457
0458 >
0459 {
0460 typedef lambda< T1,Tag > l1;
0461 typedef lambda< T2,Tag > l2;
0462 typedef lambda< T3,Tag > l3;
0463 typedef lambda< T4,Tag > l4;
0464 typedef lambda< T5,Tag > l5;
0465
0466 typedef typename l1::is_le is_le1;
0467 typedef typename l2::is_le is_le2;
0468 typedef typename l3::is_le is_le3;
0469 typedef typename l4::is_le is_le4;
0470 typedef typename l5::is_le is_le5;
0471
0472
0473 typedef typename aux::lambda_or<
0474 is_le1::value, is_le2::value, is_le3::value, is_le4::value
0475 , is_le5::value
0476 >::type is_le;
0477
0478 typedef aux::le_result5<
0479 is_le, Tag, F, l1, l2, l3, l4, l5
0480 > le_result_;
0481
0482 typedef typename le_result_::result_ result_;
0483 typedef typename le_result_::type type;
0484 };
0485
0486 template<
0487 typename F, typename T1, typename T2, typename T3, typename T4
0488 , typename T5
0489 , typename Tag
0490 >
0491 struct lambda<
0492 bind5< F,T1,T2,T3,T4,T5 >
0493 , Tag
0494
0495 >
0496 {
0497 typedef false_ is_le;
0498 typedef bind5<
0499 F
0500 , T1, T2, T3, T4, T5
0501 > result_;
0502
0503 typedef result_ type;
0504 };
0505
0506
0507 template< typename T, typename Tag >
0508 struct lambda< mpl::protect<T>, Tag >
0509 {
0510 typedef false_ is_le;
0511 typedef mpl::protect<T> result_;
0512 typedef result_ type;
0513 };
0514
0515
0516
0517 template<
0518 typename F, typename T1, typename T2, typename T3, typename T4
0519 , typename T5
0520 , typename Tag
0521 >
0522 struct lambda<
0523 bind< F,T1,T2,T3,T4,T5 >
0524 , Tag
0525
0526 >
0527 {
0528 typedef false_ is_le;
0529 typedef bind< F,T1,T2,T3,T4,T5 > result_;
0530 typedef result_ type;
0531 };
0532
0533
0534
0535 template<
0536 typename F, typename Tag1, typename Tag2
0537 >
0538 struct lambda<
0539 lambda< F,Tag1 >
0540 , Tag2
0541 >
0542 {
0543 typedef lambda< F,Tag2 > l1;
0544 typedef lambda< Tag1,Tag2 > l2;
0545 typedef typename l1::is_le is_le;
0546 typedef aux::le_result2<is_le, Tag2, mpl::lambda, l1, l2> le_result_;
0547 typedef typename le_result_::result_ result_;
0548 typedef typename le_result_::type type;
0549 };
0550
0551 BOOST_MPL_AUX_NA_SPEC(2, lambda)
0552
0553 }}
0554