lambda_no_ctps.hpp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. // Copyright Aleksey Gurtovoy 2000-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_/lambda_no_ctps.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. template< typename Arity > struct lambda_impl
  25. {
  26. template< typename T, typename Tag, typename Protect > struct result_
  27. {
  28. typedef T type;
  29. typedef is_placeholder<T> is_le;
  30. };
  31. };
  32. template<> struct lambda_impl< int_<1> >
  33. {
  34. template< typename F, typename Tag, typename Protect > struct result_
  35. {
  36. typedef lambda< typename F::arg1, Tag, false_ > l1;
  37. typedef typename l1::is_le is_le1;
  38. typedef aux::lambda_or<
  39. BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le1)::value
  40. > is_le;
  41. typedef bind1<
  42. typename F::rebind
  43. , typename l1::type
  44. > bind_;
  45. typedef typename if_<
  46. is_le
  47. , if_< Protect, mpl::protect<bind_>, bind_ >
  48. , identity<F>
  49. >::type type_;
  50. typedef typename type_::type type;
  51. };
  52. };
  53. template<> struct lambda_impl< int_<2> >
  54. {
  55. template< typename F, typename Tag, typename Protect > struct result_
  56. {
  57. typedef lambda< typename F::arg1, Tag, false_ > l1;
  58. typedef lambda< typename F::arg2, Tag, false_ > l2;
  59. typedef typename l1::is_le is_le1;
  60. typedef typename l2::is_le is_le2;
  61. typedef aux::lambda_or<
  62. BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le1)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le2)::value
  63. > is_le;
  64. typedef bind2<
  65. typename F::rebind
  66. , typename l1::type, typename l2::type
  67. > bind_;
  68. typedef typename if_<
  69. is_le
  70. , if_< Protect, mpl::protect<bind_>, bind_ >
  71. , identity<F>
  72. >::type type_;
  73. typedef typename type_::type type;
  74. };
  75. };
  76. template<> struct lambda_impl< int_<3> >
  77. {
  78. template< typename F, typename Tag, typename Protect > struct result_
  79. {
  80. typedef lambda< typename F::arg1, Tag, false_ > l1;
  81. typedef lambda< typename F::arg2, Tag, false_ > l2;
  82. typedef lambda< typename F::arg3, Tag, false_ > l3;
  83. typedef typename l1::is_le is_le1;
  84. typedef typename l2::is_le is_le2;
  85. typedef typename l3::is_le is_le3;
  86. typedef aux::lambda_or<
  87. BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le1)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le2)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le3)::value
  88. > is_le;
  89. typedef bind3<
  90. typename F::rebind
  91. , typename l1::type, typename l2::type, typename l3::type
  92. > bind_;
  93. typedef typename if_<
  94. is_le
  95. , if_< Protect, mpl::protect<bind_>, bind_ >
  96. , identity<F>
  97. >::type type_;
  98. typedef typename type_::type type;
  99. };
  100. };
  101. template<> struct lambda_impl< int_<4> >
  102. {
  103. template< typename F, typename Tag, typename Protect > struct result_
  104. {
  105. typedef lambda< typename F::arg1, Tag, false_ > l1;
  106. typedef lambda< typename F::arg2, Tag, false_ > l2;
  107. typedef lambda< typename F::arg3, Tag, false_ > l3;
  108. typedef lambda< typename F::arg4, Tag, false_ > l4;
  109. typedef typename l1::is_le is_le1;
  110. typedef typename l2::is_le is_le2;
  111. typedef typename l3::is_le is_le3;
  112. typedef typename l4::is_le is_le4;
  113. typedef aux::lambda_or<
  114. BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le1)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le2)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le3)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le4)::value
  115. > is_le;
  116. typedef bind4<
  117. typename F::rebind
  118. , typename l1::type, typename l2::type, typename l3::type
  119. , typename l4::type
  120. > bind_;
  121. typedef typename if_<
  122. is_le
  123. , if_< Protect, mpl::protect<bind_>, bind_ >
  124. , identity<F>
  125. >::type type_;
  126. typedef typename type_::type type;
  127. };
  128. };
  129. template<> struct lambda_impl< int_<5> >
  130. {
  131. template< typename F, typename Tag, typename Protect > struct result_
  132. {
  133. typedef lambda< typename F::arg1, Tag, false_ > l1;
  134. typedef lambda< typename F::arg2, Tag, false_ > l2;
  135. typedef lambda< typename F::arg3, Tag, false_ > l3;
  136. typedef lambda< typename F::arg4, Tag, false_ > l4;
  137. typedef lambda< typename F::arg5, Tag, false_ > l5;
  138. typedef typename l1::is_le is_le1;
  139. typedef typename l2::is_le is_le2;
  140. typedef typename l3::is_le is_le3;
  141. typedef typename l4::is_le is_le4;
  142. typedef typename l5::is_le is_le5;
  143. typedef aux::lambda_or<
  144. BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le1)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le2)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le3)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le4)::value, BOOST_MPL_AUX_MSVC_VALUE_WKND(is_le5)::value
  145. > is_le;
  146. typedef bind5<
  147. typename F::rebind
  148. , typename l1::type, typename l2::type, typename l3::type
  149. , typename l4::type, typename l5::type
  150. > bind_;
  151. typedef typename if_<
  152. is_le
  153. , if_< Protect, mpl::protect<bind_>, bind_ >
  154. , identity<F>
  155. >::type type_;
  156. typedef typename type_::type type;
  157. };
  158. };
  159. } // namespace aux
  160. template<
  161. typename T
  162. , typename Tag
  163. , typename Protect
  164. >
  165. struct lambda
  166. {
  167. /// Metafunction forwarding confuses MSVC 6.x
  168. typedef typename aux::template_arity<T>::type arity_;
  169. typedef typename aux::lambda_impl<arity_>
  170. ::template result_< T,Tag,Protect > l_;
  171. typedef typename l_::type type;
  172. typedef typename l_::is_le is_le;
  173. BOOST_MPL_AUX_LAMBDA_SUPPORT(3, lambda, (T, Tag, Protect))
  174. };
  175. BOOST_MPL_AUX_NA_SPEC2(1, 3, lambda)
  176. template<
  177. typename T
  178. >
  179. struct is_lambda_expression
  180. : lambda<T>::is_le
  181. {
  182. };
  183. }}