Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | |
| 2 | // Copyright Aleksey Gurtovoy 2001-2004 |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. |
| 5 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | |
| 9 | // Preprocessed version of "ndnboost/mpl/aux_/full_lambda.hpp" header |
| 10 | // -- DO NOT modify by hand! |
| 11 | |
| 12 | namespace ndnboost { namespace mpl { |
| 13 | |
| 14 | namespace aux { |
| 15 | |
| 16 | template< |
| 17 | bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false |
| 18 | , bool C5 = false |
| 19 | > |
| 20 | struct lambda_or |
| 21 | : true_ |
| 22 | { |
| 23 | }; |
| 24 | |
| 25 | template<> |
| 26 | struct lambda_or< false,false,false,false,false > |
| 27 | : false_ |
| 28 | { |
| 29 | }; |
| 30 | |
| 31 | } // namespace aux |
| 32 | |
| 33 | template< |
| 34 | typename T |
| 35 | , typename Tag |
| 36 | |
| 37 | > |
| 38 | struct lambda |
| 39 | { |
| 40 | typedef false_ is_le; |
| 41 | typedef T result_; |
| 42 | typedef T type; |
| 43 | }; |
| 44 | |
| 45 | template< |
| 46 | typename T |
| 47 | > |
| 48 | struct is_lambda_expression |
| 49 | : lambda<T>::is_le |
| 50 | { |
| 51 | }; |
| 52 | |
| 53 | template< int N, typename Tag > |
| 54 | struct lambda< arg<N>, Tag > |
| 55 | { |
| 56 | typedef true_ is_le; |
| 57 | typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41 |
| 58 | typedef mpl::protect<result_> type; |
| 59 | }; |
| 60 | |
| 61 | template< |
| 62 | typename F |
| 63 | , typename Tag |
| 64 | > |
| 65 | struct lambda< |
| 66 | bind0<F> |
| 67 | , Tag |
| 68 | |
| 69 | > |
| 70 | { |
| 71 | typedef false_ is_le; |
| 72 | typedef bind0< |
| 73 | F |
| 74 | > result_; |
| 75 | |
| 76 | typedef result_ type; |
| 77 | }; |
| 78 | |
| 79 | namespace aux { |
| 80 | |
| 81 | template< |
| 82 | typename IsLE, typename Tag |
| 83 | , template< typename P1 > class F |
| 84 | , typename L1 |
| 85 | > |
| 86 | struct le_result1 |
| 87 | { |
| 88 | typedef F< |
| 89 | typename L1::type |
| 90 | > result_; |
| 91 | |
| 92 | typedef result_ type; |
| 93 | }; |
| 94 | |
| 95 | template< |
| 96 | typename Tag |
| 97 | , template< typename P1 > class F |
| 98 | , typename L1 |
| 99 | > |
| 100 | struct le_result1< true_,Tag,F,L1 > |
| 101 | { |
| 102 | typedef bind1< |
| 103 | quote1< F,Tag > |
| 104 | , typename L1::result_ |
| 105 | > result_; |
| 106 | |
| 107 | typedef mpl::protect<result_> type; |
| 108 | }; |
| 109 | |
| 110 | } // namespace aux |
| 111 | |
| 112 | template< |
| 113 | template< typename P1 > class F |
| 114 | , typename T1 |
| 115 | , typename Tag |
| 116 | > |
| 117 | struct lambda< |
| 118 | F<T1> |
| 119 | , Tag |
| 120 | |
| 121 | > |
| 122 | { |
| 123 | typedef lambda< T1,Tag > l1; |
| 124 | typedef typename l1::is_le is_le1; |
| 125 | typedef typename aux::lambda_or< |
| 126 | is_le1::value |
| 127 | >::type is_le; |
| 128 | |
| 129 | typedef aux::le_result1< |
| 130 | is_le, Tag, F, l1 |
| 131 | > le_result_; |
| 132 | |
| 133 | typedef typename le_result_::result_ result_; |
| 134 | typedef typename le_result_::type type; |
| 135 | }; |
| 136 | |
| 137 | template< |
| 138 | typename F, typename T1 |
| 139 | , typename Tag |
| 140 | > |
| 141 | struct lambda< |
| 142 | bind1< F,T1 > |
| 143 | , Tag |
| 144 | |
| 145 | > |
| 146 | { |
| 147 | typedef false_ is_le; |
| 148 | typedef bind1< |
| 149 | F |
| 150 | , T1 |
| 151 | > result_; |
| 152 | |
| 153 | typedef result_ type; |
| 154 | }; |
| 155 | |
| 156 | namespace aux { |
| 157 | |
| 158 | template< |
| 159 | typename IsLE, typename Tag |
| 160 | , template< typename P1, typename P2 > class F |
| 161 | , typename L1, typename L2 |
| 162 | > |
| 163 | struct le_result2 |
| 164 | { |
| 165 | typedef F< |
| 166 | typename L1::type, typename L2::type |
| 167 | > result_; |
| 168 | |
| 169 | typedef result_ type; |
| 170 | }; |
| 171 | |
| 172 | template< |
| 173 | typename Tag |
| 174 | , template< typename P1, typename P2 > class F |
| 175 | , typename L1, typename L2 |
| 176 | > |
| 177 | struct le_result2< true_,Tag,F,L1,L2 > |
| 178 | { |
| 179 | typedef bind2< |
| 180 | quote2< F,Tag > |
| 181 | , typename L1::result_, typename L2::result_ |
| 182 | > result_; |
| 183 | |
| 184 | typedef mpl::protect<result_> type; |
| 185 | }; |
| 186 | |
| 187 | } // namespace aux |
| 188 | |
| 189 | template< |
| 190 | template< typename P1, typename P2 > class F |
| 191 | , typename T1, typename T2 |
| 192 | , typename Tag |
| 193 | > |
| 194 | struct lambda< |
| 195 | F< T1,T2 > |
| 196 | , Tag |
| 197 | |
| 198 | > |
| 199 | { |
| 200 | typedef lambda< T1,Tag > l1; |
| 201 | typedef lambda< T2,Tag > l2; |
| 202 | |
| 203 | typedef typename l1::is_le is_le1; |
| 204 | typedef typename l2::is_le is_le2; |
| 205 | |
| 206 | |
| 207 | typedef typename aux::lambda_or< |
| 208 | is_le1::value, is_le2::value |
| 209 | >::type is_le; |
| 210 | |
| 211 | typedef aux::le_result2< |
| 212 | is_le, Tag, F, l1, l2 |
| 213 | > le_result_; |
| 214 | |
| 215 | typedef typename le_result_::result_ result_; |
| 216 | typedef typename le_result_::type type; |
| 217 | }; |
| 218 | |
| 219 | template< |
| 220 | typename F, typename T1, typename T2 |
| 221 | , typename Tag |
| 222 | > |
| 223 | struct lambda< |
| 224 | bind2< F,T1,T2 > |
| 225 | , Tag |
| 226 | |
| 227 | > |
| 228 | { |
| 229 | typedef false_ is_le; |
| 230 | typedef bind2< |
| 231 | F |
| 232 | , T1, T2 |
| 233 | > result_; |
| 234 | |
| 235 | typedef result_ type; |
| 236 | }; |
| 237 | |
| 238 | namespace aux { |
| 239 | |
| 240 | template< |
| 241 | typename IsLE, typename Tag |
| 242 | , template< typename P1, typename P2, typename P3 > class F |
| 243 | , typename L1, typename L2, typename L3 |
| 244 | > |
| 245 | struct le_result3 |
| 246 | { |
| 247 | typedef F< |
| 248 | typename L1::type, typename L2::type, typename L3::type |
| 249 | > result_; |
| 250 | |
| 251 | typedef result_ type; |
| 252 | }; |
| 253 | |
| 254 | template< |
| 255 | typename Tag |
| 256 | , template< typename P1, typename P2, typename P3 > class F |
| 257 | , typename L1, typename L2, typename L3 |
| 258 | > |
| 259 | struct le_result3< true_,Tag,F,L1,L2,L3 > |
| 260 | { |
| 261 | typedef bind3< |
| 262 | quote3< F,Tag > |
| 263 | , typename L1::result_, typename L2::result_, typename L3::result_ |
| 264 | > result_; |
| 265 | |
| 266 | typedef mpl::protect<result_> type; |
| 267 | }; |
| 268 | |
| 269 | } // namespace aux |
| 270 | |
| 271 | template< |
| 272 | template< typename P1, typename P2, typename P3 > class F |
| 273 | , typename T1, typename T2, typename T3 |
| 274 | , typename Tag |
| 275 | > |
| 276 | struct lambda< |
| 277 | F< T1,T2,T3 > |
| 278 | , Tag |
| 279 | |
| 280 | > |
| 281 | { |
| 282 | typedef lambda< T1,Tag > l1; |
| 283 | typedef lambda< T2,Tag > l2; |
| 284 | typedef lambda< T3,Tag > l3; |
| 285 | |
| 286 | typedef typename l1::is_le is_le1; |
| 287 | typedef typename l2::is_le is_le2; |
| 288 | typedef typename l3::is_le is_le3; |
| 289 | |
| 290 | |
| 291 | typedef typename aux::lambda_or< |
| 292 | is_le1::value, is_le2::value, is_le3::value |
| 293 | >::type is_le; |
| 294 | |
| 295 | typedef aux::le_result3< |
| 296 | is_le, Tag, F, l1, l2, l3 |
| 297 | > le_result_; |
| 298 | |
| 299 | typedef typename le_result_::result_ result_; |
| 300 | typedef typename le_result_::type type; |
| 301 | }; |
| 302 | |
| 303 | template< |
| 304 | typename F, typename T1, typename T2, typename T3 |
| 305 | , typename Tag |
| 306 | > |
| 307 | struct lambda< |
| 308 | bind3< F,T1,T2,T3 > |
| 309 | , Tag |
| 310 | |
| 311 | > |
| 312 | { |
| 313 | typedef false_ is_le; |
| 314 | typedef bind3< |
| 315 | F |
| 316 | , T1, T2, T3 |
| 317 | > result_; |
| 318 | |
| 319 | typedef result_ type; |
| 320 | }; |
| 321 | |
| 322 | namespace aux { |
| 323 | |
| 324 | template< |
| 325 | typename IsLE, typename Tag |
| 326 | , template< typename P1, typename P2, typename P3, typename P4 > class F |
| 327 | , typename L1, typename L2, typename L3, typename L4 |
| 328 | > |
| 329 | struct le_result4 |
| 330 | { |
| 331 | typedef F< |
| 332 | typename L1::type, typename L2::type, typename L3::type |
| 333 | , typename L4::type |
| 334 | > result_; |
| 335 | |
| 336 | typedef result_ type; |
| 337 | }; |
| 338 | |
| 339 | template< |
| 340 | typename Tag |
| 341 | , template< typename P1, typename P2, typename P3, typename P4 > class F |
| 342 | , typename L1, typename L2, typename L3, typename L4 |
| 343 | > |
| 344 | struct le_result4< true_,Tag,F,L1,L2,L3,L4 > |
| 345 | { |
| 346 | typedef bind4< |
| 347 | quote4< F,Tag > |
| 348 | , typename L1::result_, typename L2::result_, typename L3::result_ |
| 349 | , typename L4::result_ |
| 350 | > result_; |
| 351 | |
| 352 | typedef mpl::protect<result_> type; |
| 353 | }; |
| 354 | |
| 355 | } // namespace aux |
| 356 | |
| 357 | template< |
| 358 | template< typename P1, typename P2, typename P3, typename P4 > class F |
| 359 | , typename T1, typename T2, typename T3, typename T4 |
| 360 | , typename Tag |
| 361 | > |
| 362 | struct lambda< |
| 363 | F< T1,T2,T3,T4 > |
| 364 | , Tag |
| 365 | |
| 366 | > |
| 367 | { |
| 368 | typedef lambda< T1,Tag > l1; |
| 369 | typedef lambda< T2,Tag > l2; |
| 370 | typedef lambda< T3,Tag > l3; |
| 371 | typedef lambda< T4,Tag > l4; |
| 372 | |
| 373 | typedef typename l1::is_le is_le1; |
| 374 | typedef typename l2::is_le is_le2; |
| 375 | typedef typename l3::is_le is_le3; |
| 376 | typedef typename l4::is_le is_le4; |
| 377 | |
| 378 | |
| 379 | typedef typename aux::lambda_or< |
| 380 | is_le1::value, is_le2::value, is_le3::value, is_le4::value |
| 381 | >::type is_le; |
| 382 | |
| 383 | typedef aux::le_result4< |
| 384 | is_le, Tag, F, l1, l2, l3, l4 |
| 385 | > le_result_; |
| 386 | |
| 387 | typedef typename le_result_::result_ result_; |
| 388 | typedef typename le_result_::type type; |
| 389 | }; |
| 390 | |
| 391 | template< |
| 392 | typename F, typename T1, typename T2, typename T3, typename T4 |
| 393 | , typename Tag |
| 394 | > |
| 395 | struct lambda< |
| 396 | bind4< F,T1,T2,T3,T4 > |
| 397 | , Tag |
| 398 | |
| 399 | > |
| 400 | { |
| 401 | typedef false_ is_le; |
| 402 | typedef bind4< |
| 403 | F |
| 404 | , T1, T2, T3, T4 |
| 405 | > result_; |
| 406 | |
| 407 | typedef result_ type; |
| 408 | }; |
| 409 | |
| 410 | namespace aux { |
| 411 | |
| 412 | template< |
| 413 | typename IsLE, typename Tag |
| 414 | , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F |
| 415 | , typename L1, typename L2, typename L3, typename L4, typename L5 |
| 416 | > |
| 417 | struct le_result5 |
| 418 | { |
| 419 | typedef F< |
| 420 | typename L1::type, typename L2::type, typename L3::type |
| 421 | , typename L4::type, typename L5::type |
| 422 | > result_; |
| 423 | |
| 424 | typedef result_ type; |
| 425 | }; |
| 426 | |
| 427 | template< |
| 428 | typename Tag |
| 429 | , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F |
| 430 | , typename L1, typename L2, typename L3, typename L4, typename L5 |
| 431 | > |
| 432 | struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 > |
| 433 | { |
| 434 | typedef bind5< |
| 435 | quote5< F,Tag > |
| 436 | , typename L1::result_, typename L2::result_, typename L3::result_ |
| 437 | , typename L4::result_, typename L5::result_ |
| 438 | > result_; |
| 439 | |
| 440 | typedef mpl::protect<result_> type; |
| 441 | }; |
| 442 | |
| 443 | } // namespace aux |
| 444 | |
| 445 | template< |
| 446 | template< |
| 447 | typename P1, typename P2, typename P3, typename P4 |
| 448 | , typename P5 |
| 449 | > |
| 450 | class F |
| 451 | , typename T1, typename T2, typename T3, typename T4, typename T5 |
| 452 | , typename Tag |
| 453 | > |
| 454 | struct lambda< |
| 455 | F< T1,T2,T3,T4,T5 > |
| 456 | , Tag |
| 457 | |
| 458 | > |
| 459 | { |
| 460 | typedef lambda< T1,Tag > l1; |
| 461 | typedef lambda< T2,Tag > l2; |
| 462 | typedef lambda< T3,Tag > l3; |
| 463 | typedef lambda< T4,Tag > l4; |
| 464 | typedef lambda< T5,Tag > l5; |
| 465 | |
| 466 | typedef typename l1::is_le is_le1; |
| 467 | typedef typename l2::is_le is_le2; |
| 468 | typedef typename l3::is_le is_le3; |
| 469 | typedef typename l4::is_le is_le4; |
| 470 | typedef typename l5::is_le is_le5; |
| 471 | |
| 472 | |
| 473 | typedef typename aux::lambda_or< |
| 474 | is_le1::value, is_le2::value, is_le3::value, is_le4::value |
| 475 | , is_le5::value |
| 476 | >::type is_le; |
| 477 | |
| 478 | typedef aux::le_result5< |
| 479 | is_le, Tag, F, l1, l2, l3, l4, l5 |
| 480 | > le_result_; |
| 481 | |
| 482 | typedef typename le_result_::result_ result_; |
| 483 | typedef typename le_result_::type type; |
| 484 | }; |
| 485 | |
| 486 | template< |
| 487 | typename F, typename T1, typename T2, typename T3, typename T4 |
| 488 | , typename T5 |
| 489 | , typename Tag |
| 490 | > |
| 491 | struct lambda< |
| 492 | bind5< F,T1,T2,T3,T4,T5 > |
| 493 | , Tag |
| 494 | |
| 495 | > |
| 496 | { |
| 497 | typedef false_ is_le; |
| 498 | typedef bind5< |
| 499 | F |
| 500 | , T1, T2, T3, T4, T5 |
| 501 | > result_; |
| 502 | |
| 503 | typedef result_ type; |
| 504 | }; |
| 505 | |
| 506 | /// special case for 'protect' |
| 507 | template< typename T, typename Tag > |
| 508 | struct lambda< mpl::protect<T>, Tag > |
| 509 | { |
| 510 | typedef false_ is_le; |
| 511 | typedef mpl::protect<T> result_; |
| 512 | typedef result_ type; |
| 513 | }; |
| 514 | |
| 515 | /// specializations for the main 'bind' form |
| 516 | |
| 517 | template< |
| 518 | typename F, typename T1, typename T2, typename T3, typename T4 |
| 519 | , typename T5 |
| 520 | , typename Tag |
| 521 | > |
| 522 | struct lambda< |
| 523 | bind< F,T1,T2,T3,T4,T5 > |
| 524 | , Tag |
| 525 | |
| 526 | > |
| 527 | { |
| 528 | typedef false_ is_le; |
| 529 | typedef bind< F,T1,T2,T3,T4,T5 > result_; |
| 530 | typedef result_ type; |
| 531 | }; |
| 532 | |
| 533 | /// workaround for MWCW 8.3+/EDG < 303, leads to ambiguity on Digital Mars |
| 534 | |
| 535 | template< |
| 536 | typename F, typename Tag1, typename Tag2 |
| 537 | > |
| 538 | struct lambda< |
| 539 | lambda< F,Tag1 > |
| 540 | , Tag2 |
| 541 | > |
| 542 | { |
| 543 | typedef lambda< F,Tag2 > l1; |
| 544 | typedef lambda< Tag1,Tag2 > l2; |
| 545 | typedef typename l1::is_le is_le; |
| 546 | typedef aux::le_result2<is_le, Tag2, mpl::lambda, l1, l2> le_result_; |
| 547 | typedef typename le_result_::result_ result_; |
| 548 | typedef typename le_result_::type type; |
| 549 | }; |
| 550 | |
| 551 | BOOST_MPL_AUX_NA_SPEC(2, lambda) |
| 552 | |
| 553 | }} |
| 554 | |