full_lambda.hpp 11 KB

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