vector.hpp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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/vector.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl {
  10. namespace aux {
  11. template< int N >
  12. struct vector_chooser;
  13. }
  14. namespace aux {
  15. template<>
  16. struct vector_chooser<0>
  17. {
  18. template<
  19. typename T0, typename T1, typename T2, typename T3, typename T4
  20. , typename T5, typename T6, typename T7, typename T8, typename T9
  21. , typename T10, typename T11, typename T12, typename T13, typename T14
  22. , typename T15, typename T16, typename T17, typename T18, typename T19
  23. >
  24. struct result_
  25. {
  26. typedef vector0<
  27. >::type type;
  28. };
  29. };
  30. } // namespace aux
  31. namespace aux {
  32. template<>
  33. struct vector_chooser<1>
  34. {
  35. template<
  36. typename T0, typename T1, typename T2, typename T3, typename T4
  37. , typename T5, typename T6, typename T7, typename T8, typename T9
  38. , typename T10, typename T11, typename T12, typename T13, typename T14
  39. , typename T15, typename T16, typename T17, typename T18, typename T19
  40. >
  41. struct result_
  42. {
  43. typedef typename vector1<
  44. T0
  45. >::type type;
  46. };
  47. };
  48. } // namespace aux
  49. namespace aux {
  50. template<>
  51. struct vector_chooser<2>
  52. {
  53. template<
  54. typename T0, typename T1, typename T2, typename T3, typename T4
  55. , typename T5, typename T6, typename T7, typename T8, typename T9
  56. , typename T10, typename T11, typename T12, typename T13, typename T14
  57. , typename T15, typename T16, typename T17, typename T18, typename T19
  58. >
  59. struct result_
  60. {
  61. typedef typename vector2<
  62. T0, T1
  63. >::type type;
  64. };
  65. };
  66. } // namespace aux
  67. namespace aux {
  68. template<>
  69. struct vector_chooser<3>
  70. {
  71. template<
  72. typename T0, typename T1, typename T2, typename T3, typename T4
  73. , typename T5, typename T6, typename T7, typename T8, typename T9
  74. , typename T10, typename T11, typename T12, typename T13, typename T14
  75. , typename T15, typename T16, typename T17, typename T18, typename T19
  76. >
  77. struct result_
  78. {
  79. typedef typename vector3<
  80. T0, T1, T2
  81. >::type type;
  82. };
  83. };
  84. } // namespace aux
  85. namespace aux {
  86. template<>
  87. struct vector_chooser<4>
  88. {
  89. template<
  90. typename T0, typename T1, typename T2, typename T3, typename T4
  91. , typename T5, typename T6, typename T7, typename T8, typename T9
  92. , typename T10, typename T11, typename T12, typename T13, typename T14
  93. , typename T15, typename T16, typename T17, typename T18, typename T19
  94. >
  95. struct result_
  96. {
  97. typedef typename vector4<
  98. T0, T1, T2, T3
  99. >::type type;
  100. };
  101. };
  102. } // namespace aux
  103. namespace aux {
  104. template<>
  105. struct vector_chooser<5>
  106. {
  107. template<
  108. typename T0, typename T1, typename T2, typename T3, typename T4
  109. , typename T5, typename T6, typename T7, typename T8, typename T9
  110. , typename T10, typename T11, typename T12, typename T13, typename T14
  111. , typename T15, typename T16, typename T17, typename T18, typename T19
  112. >
  113. struct result_
  114. {
  115. typedef typename vector5<
  116. T0, T1, T2, T3, T4
  117. >::type type;
  118. };
  119. };
  120. } // namespace aux
  121. namespace aux {
  122. template<>
  123. struct vector_chooser<6>
  124. {
  125. template<
  126. typename T0, typename T1, typename T2, typename T3, typename T4
  127. , typename T5, typename T6, typename T7, typename T8, typename T9
  128. , typename T10, typename T11, typename T12, typename T13, typename T14
  129. , typename T15, typename T16, typename T17, typename T18, typename T19
  130. >
  131. struct result_
  132. {
  133. typedef typename vector6<
  134. T0, T1, T2, T3, T4, T5
  135. >::type type;
  136. };
  137. };
  138. } // namespace aux
  139. namespace aux {
  140. template<>
  141. struct vector_chooser<7>
  142. {
  143. template<
  144. typename T0, typename T1, typename T2, typename T3, typename T4
  145. , typename T5, typename T6, typename T7, typename T8, typename T9
  146. , typename T10, typename T11, typename T12, typename T13, typename T14
  147. , typename T15, typename T16, typename T17, typename T18, typename T19
  148. >
  149. struct result_
  150. {
  151. typedef typename vector7<
  152. T0, T1, T2, T3, T4, T5, T6
  153. >::type type;
  154. };
  155. };
  156. } // namespace aux
  157. namespace aux {
  158. template<>
  159. struct vector_chooser<8>
  160. {
  161. template<
  162. typename T0, typename T1, typename T2, typename T3, typename T4
  163. , typename T5, typename T6, typename T7, typename T8, typename T9
  164. , typename T10, typename T11, typename T12, typename T13, typename T14
  165. , typename T15, typename T16, typename T17, typename T18, typename T19
  166. >
  167. struct result_
  168. {
  169. typedef typename vector8<
  170. T0, T1, T2, T3, T4, T5, T6, T7
  171. >::type type;
  172. };
  173. };
  174. } // namespace aux
  175. namespace aux {
  176. template<>
  177. struct vector_chooser<9>
  178. {
  179. template<
  180. typename T0, typename T1, typename T2, typename T3, typename T4
  181. , typename T5, typename T6, typename T7, typename T8, typename T9
  182. , typename T10, typename T11, typename T12, typename T13, typename T14
  183. , typename T15, typename T16, typename T17, typename T18, typename T19
  184. >
  185. struct result_
  186. {
  187. typedef typename vector9<
  188. T0, T1, T2, T3, T4, T5, T6, T7, T8
  189. >::type type;
  190. };
  191. };
  192. } // namespace aux
  193. namespace aux {
  194. template<>
  195. struct vector_chooser<10>
  196. {
  197. template<
  198. typename T0, typename T1, typename T2, typename T3, typename T4
  199. , typename T5, typename T6, typename T7, typename T8, typename T9
  200. , typename T10, typename T11, typename T12, typename T13, typename T14
  201. , typename T15, typename T16, typename T17, typename T18, typename T19
  202. >
  203. struct result_
  204. {
  205. typedef typename vector10<
  206. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9
  207. >::type type;
  208. };
  209. };
  210. } // namespace aux
  211. namespace aux {
  212. template<>
  213. struct vector_chooser<11>
  214. {
  215. template<
  216. typename T0, typename T1, typename T2, typename T3, typename T4
  217. , typename T5, typename T6, typename T7, typename T8, typename T9
  218. , typename T10, typename T11, typename T12, typename T13, typename T14
  219. , typename T15, typename T16, typename T17, typename T18, typename T19
  220. >
  221. struct result_
  222. {
  223. typedef typename vector11<
  224. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
  225. >::type type;
  226. };
  227. };
  228. } // namespace aux
  229. namespace aux {
  230. template<>
  231. struct vector_chooser<12>
  232. {
  233. template<
  234. typename T0, typename T1, typename T2, typename T3, typename T4
  235. , typename T5, typename T6, typename T7, typename T8, typename T9
  236. , typename T10, typename T11, typename T12, typename T13, typename T14
  237. , typename T15, typename T16, typename T17, typename T18, typename T19
  238. >
  239. struct result_
  240. {
  241. typedef typename vector12<
  242. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11
  243. >::type type;
  244. };
  245. };
  246. } // namespace aux
  247. namespace aux {
  248. template<>
  249. struct vector_chooser<13>
  250. {
  251. template<
  252. typename T0, typename T1, typename T2, typename T3, typename T4
  253. , typename T5, typename T6, typename T7, typename T8, typename T9
  254. , typename T10, typename T11, typename T12, typename T13, typename T14
  255. , typename T15, typename T16, typename T17, typename T18, typename T19
  256. >
  257. struct result_
  258. {
  259. typedef typename vector13<
  260. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12
  261. >::type type;
  262. };
  263. };
  264. } // namespace aux
  265. namespace aux {
  266. template<>
  267. struct vector_chooser<14>
  268. {
  269. template<
  270. typename T0, typename T1, typename T2, typename T3, typename T4
  271. , typename T5, typename T6, typename T7, typename T8, typename T9
  272. , typename T10, typename T11, typename T12, typename T13, typename T14
  273. , typename T15, typename T16, typename T17, typename T18, typename T19
  274. >
  275. struct result_
  276. {
  277. typedef typename vector14<
  278. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13
  279. >::type type;
  280. };
  281. };
  282. } // namespace aux
  283. namespace aux {
  284. template<>
  285. struct vector_chooser<15>
  286. {
  287. template<
  288. typename T0, typename T1, typename T2, typename T3, typename T4
  289. , typename T5, typename T6, typename T7, typename T8, typename T9
  290. , typename T10, typename T11, typename T12, typename T13, typename T14
  291. , typename T15, typename T16, typename T17, typename T18, typename T19
  292. >
  293. struct result_
  294. {
  295. typedef typename vector15<
  296. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
  297. >::type type;
  298. };
  299. };
  300. } // namespace aux
  301. namespace aux {
  302. template<>
  303. struct vector_chooser<16>
  304. {
  305. template<
  306. typename T0, typename T1, typename T2, typename T3, typename T4
  307. , typename T5, typename T6, typename T7, typename T8, typename T9
  308. , typename T10, typename T11, typename T12, typename T13, typename T14
  309. , typename T15, typename T16, typename T17, typename T18, typename T19
  310. >
  311. struct result_
  312. {
  313. typedef typename vector16<
  314. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
  315. >::type type;
  316. };
  317. };
  318. } // namespace aux
  319. namespace aux {
  320. template<>
  321. struct vector_chooser<17>
  322. {
  323. template<
  324. typename T0, typename T1, typename T2, typename T3, typename T4
  325. , typename T5, typename T6, typename T7, typename T8, typename T9
  326. , typename T10, typename T11, typename T12, typename T13, typename T14
  327. , typename T15, typename T16, typename T17, typename T18, typename T19
  328. >
  329. struct result_
  330. {
  331. typedef typename vector17<
  332. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16
  333. >::type type;
  334. };
  335. };
  336. } // namespace aux
  337. namespace aux {
  338. template<>
  339. struct vector_chooser<18>
  340. {
  341. template<
  342. typename T0, typename T1, typename T2, typename T3, typename T4
  343. , typename T5, typename T6, typename T7, typename T8, typename T9
  344. , typename T10, typename T11, typename T12, typename T13, typename T14
  345. , typename T15, typename T16, typename T17, typename T18, typename T19
  346. >
  347. struct result_
  348. {
  349. typedef typename vector18<
  350. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17
  351. >::type type;
  352. };
  353. };
  354. } // namespace aux
  355. namespace aux {
  356. template<>
  357. struct vector_chooser<19>
  358. {
  359. template<
  360. typename T0, typename T1, typename T2, typename T3, typename T4
  361. , typename T5, typename T6, typename T7, typename T8, typename T9
  362. , typename T10, typename T11, typename T12, typename T13, typename T14
  363. , typename T15, typename T16, typename T17, typename T18, typename T19
  364. >
  365. struct result_
  366. {
  367. typedef typename vector19<
  368. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18
  369. >::type type;
  370. };
  371. };
  372. } // namespace aux
  373. namespace aux {
  374. template<>
  375. struct vector_chooser<20>
  376. {
  377. template<
  378. typename T0, typename T1, typename T2, typename T3, typename T4
  379. , typename T5, typename T6, typename T7, typename T8, typename T9
  380. , typename T10, typename T11, typename T12, typename T13, typename T14
  381. , typename T15, typename T16, typename T17, typename T18, typename T19
  382. >
  383. struct result_
  384. {
  385. typedef typename vector20<
  386. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19
  387. >::type type;
  388. };
  389. };
  390. } // namespace aux
  391. namespace aux {
  392. template< typename T >
  393. struct is_vector_arg
  394. {
  395. BOOST_STATIC_CONSTANT(bool, value = true);
  396. };
  397. template<>
  398. struct is_vector_arg<na>
  399. {
  400. BOOST_STATIC_CONSTANT(bool, value = false);
  401. };
  402. template<
  403. typename T1, typename T2, typename T3, typename T4, typename T5
  404. , typename T6, typename T7, typename T8, typename T9, typename T10
  405. , typename T11, typename T12, typename T13, typename T14, typename T15
  406. , typename T16, typename T17, typename T18, typename T19, typename T20
  407. >
  408. struct vector_count_args
  409. {
  410. BOOST_STATIC_CONSTANT(int, value =
  411. is_vector_arg<T1>::value + is_vector_arg<T2>::value
  412. + is_vector_arg<T3>::value + is_vector_arg<T4>::value
  413. + is_vector_arg<T5>::value + is_vector_arg<T6>::value
  414. + is_vector_arg<T7>::value + is_vector_arg<T8>::value
  415. + is_vector_arg<T9>::value + is_vector_arg<T10>::value
  416. + is_vector_arg<T11>::value + is_vector_arg<T12>::value
  417. + is_vector_arg<T13>::value + is_vector_arg<T14>::value
  418. + is_vector_arg<T15>::value + is_vector_arg<T16>::value
  419. + is_vector_arg<T17>::value + is_vector_arg<T18>::value
  420. + is_vector_arg<T19>::value + is_vector_arg<T20>::value
  421. );
  422. };
  423. template<
  424. typename T0, typename T1, typename T2, typename T3, typename T4
  425. , typename T5, typename T6, typename T7, typename T8, typename T9
  426. , typename T10, typename T11, typename T12, typename T13, typename T14
  427. , typename T15, typename T16, typename T17, typename T18, typename T19
  428. >
  429. struct vector_impl
  430. {
  431. typedef aux::vector_count_args<
  432. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19
  433. > arg_num_;
  434. typedef typename aux::vector_chooser< arg_num_::value >
  435. ::template result_< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >::type type;
  436. };
  437. } // namespace aux
  438. template<
  439. typename T0 = na, typename T1 = na, typename T2 = na, typename T3 = na
  440. , typename T4 = na, typename T5 = na, typename T6 = na, typename T7 = na
  441. , typename T8 = na, typename T9 = na, typename T10 = na, typename T11 = na
  442. , typename T12 = na, typename T13 = na, typename T14 = na
  443. , typename T15 = na, typename T16 = na, typename T17 = na
  444. , typename T18 = na, typename T19 = na
  445. >
  446. struct vector
  447. : aux::vector_impl<
  448. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19
  449. >::type
  450. {
  451. typedef typename aux::vector_impl<
  452. T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19
  453. >::type type;
  454. };
  455. }}