apply.hpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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/apply.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl {
  10. template<
  11. typename F
  12. >
  13. struct apply0
  14. : apply_wrap0<
  15. typename lambda<F>::type
  16. >
  17. {
  18. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  19. 1
  20. , apply0
  21. , (F )
  22. )
  23. };
  24. namespace aux {
  25. template<>
  26. struct apply_chooser<0>
  27. {
  28. template<
  29. typename F, typename T1, typename T2, typename T3, typename T4
  30. , typename T5
  31. >
  32. struct result_
  33. {
  34. typedef apply0<
  35. F
  36. > type;
  37. };
  38. };
  39. } // namespace aux
  40. template<
  41. typename F, typename T1
  42. >
  43. struct apply1
  44. : apply_wrap1<
  45. typename lambda<F>::type
  46. , T1
  47. >
  48. {
  49. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  50. 2
  51. , apply1
  52. , (F, T1)
  53. )
  54. };
  55. namespace aux {
  56. template<>
  57. struct apply_chooser<1>
  58. {
  59. template<
  60. typename F, typename T1, typename T2, typename T3, typename T4
  61. , typename T5
  62. >
  63. struct result_
  64. {
  65. typedef apply1<
  66. F, T1
  67. > type;
  68. };
  69. };
  70. } // namespace aux
  71. template<
  72. typename F, typename T1, typename T2
  73. >
  74. struct apply2
  75. : apply_wrap2<
  76. typename lambda<F>::type
  77. , T1, T2
  78. >
  79. {
  80. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  81. 3
  82. , apply2
  83. , (F, T1, T2)
  84. )
  85. };
  86. namespace aux {
  87. template<>
  88. struct apply_chooser<2>
  89. {
  90. template<
  91. typename F, typename T1, typename T2, typename T3, typename T4
  92. , typename T5
  93. >
  94. struct result_
  95. {
  96. typedef apply2<
  97. F, T1, T2
  98. > type;
  99. };
  100. };
  101. } // namespace aux
  102. template<
  103. typename F, typename T1, typename T2, typename T3
  104. >
  105. struct apply3
  106. : apply_wrap3<
  107. typename lambda<F>::type
  108. , T1, T2, T3
  109. >
  110. {
  111. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  112. 4
  113. , apply3
  114. , (F, T1, T2, T3)
  115. )
  116. };
  117. namespace aux {
  118. template<>
  119. struct apply_chooser<3>
  120. {
  121. template<
  122. typename F, typename T1, typename T2, typename T3, typename T4
  123. , typename T5
  124. >
  125. struct result_
  126. {
  127. typedef apply3<
  128. F, T1, T2, T3
  129. > type;
  130. };
  131. };
  132. } // namespace aux
  133. template<
  134. typename F, typename T1, typename T2, typename T3, typename T4
  135. >
  136. struct apply4
  137. : apply_wrap4<
  138. typename lambda<F>::type
  139. , T1, T2, T3, T4
  140. >
  141. {
  142. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  143. 5
  144. , apply4
  145. , (F, T1, T2, T3, T4)
  146. )
  147. };
  148. namespace aux {
  149. template<>
  150. struct apply_chooser<4>
  151. {
  152. template<
  153. typename F, typename T1, typename T2, typename T3, typename T4
  154. , typename T5
  155. >
  156. struct result_
  157. {
  158. typedef apply4<
  159. F, T1, T2, T3, T4
  160. > type;
  161. };
  162. };
  163. } // namespace aux
  164. template<
  165. typename F, typename T1, typename T2, typename T3, typename T4
  166. , typename T5
  167. >
  168. struct apply5
  169. : apply_wrap5<
  170. typename lambda<F>::type
  171. , T1, T2, T3, T4, T5
  172. >
  173. {
  174. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  175. 6
  176. , apply5
  177. , (F, T1, T2, T3, T4, T5)
  178. )
  179. };
  180. namespace aux {
  181. template<>
  182. struct apply_chooser<5>
  183. {
  184. template<
  185. typename F, typename T1, typename T2, typename T3, typename T4
  186. , typename T5
  187. >
  188. struct result_
  189. {
  190. typedef apply5<
  191. F, T1, T2, T3, T4, T5
  192. > type;
  193. };
  194. };
  195. } // namespace aux
  196. namespace aux {
  197. template< typename T >
  198. struct is_apply_arg
  199. {
  200. static bool const value = true;
  201. };
  202. template<>
  203. struct is_apply_arg<na>
  204. {
  205. static bool const value = false;
  206. };
  207. template<
  208. typename T1, typename T2, typename T3, typename T4, typename T5
  209. >
  210. struct apply_count_args
  211. {
  212. static int const value = is_apply_arg<T1>::value + is_apply_arg<T2>::value + is_apply_arg<T3>::value + is_apply_arg<T4>::value + is_apply_arg<T5>::value;
  213. };
  214. }
  215. template<
  216. typename F, typename T1 = na, typename T2 = na, typename T3 = na
  217. , typename T4 = na, typename T5 = na
  218. >
  219. struct apply
  220. : aux::apply_chooser<
  221. aux::apply_count_args< T1,T2,T3,T4,T5 >::value
  222. >::template result_< F,T1,T2,T3,T4,T5 >::type
  223. {
  224. };
  225. }}