vmd_conv.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Version 1.7 to 1.8 conversion</title>
  5. <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
  8. <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
  9. <link rel="prev" href="vmd_vc_isms.html" title="Visual C++ gotchas in VMD">
  10. <link rel="next" href="vmd_examples.html" title="Examples using VMD functionality">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="vmd_vc_isms.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_examples.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  27. <a name="variadic_macro_data.vmd_conv"></a><a class="link" href="vmd_conv.html" title="Version 1.7 to 1.8 conversion">Version 1.7 to 1.8 conversion</a>
  28. </h2></div></div></div>
  29. <p>
  30. Since the current version of VMD has been drastically changed to make it easier
  31. to use VMD functionality this section details equivalent functionality for
  32. previous version 1.7 VMD macros.
  33. </p>
  34. <p>
  35. The changes in functionality involve the parsing of sequences. The equivalent
  36. to all the V1.7 functionality, which looks for various data types at the beginning
  37. of a sequence, is encompassed by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...),
  38. where '0' is the first sequence element and 'sequence' is the sequence, with
  39. its optional parameters.
  40. </p>
  41. <h4>
  42. <a name="variadic_macro_data.vmd_conv.h0"></a>
  43. <span class="phrase"><a name="variadic_macro_data.vmd_conv.identifier"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.identifier">Identifier</a>
  44. </h4>
  45. <p>
  46. V1.7
  47. </p>
  48. <p>
  49. BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at the beginning
  50. of a sequence and returned a 2-element tuple, where the first element is the
  51. matching index starting with 1, or 0 if no identifier is found, and the second
  52. tuple element is the rest of the sequence or emptiness if no identifier is
  53. found.
  54. </p>
  55. <p>
  56. V1.8 equivalent
  57. </p>
  58. <p>
  59. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX)
  60. returns a 3-element tuple where the identifier found is the first tuple element,
  61. the rest of the sequence is the second tuple element, and the matching index,
  62. starting with 0, is the 3rd tuple element. If no identifier is found all elements
  63. of the returned tuple are empty.
  64. </p>
  65. <p>
  66. V1.7
  67. </p>
  68. <p>
  69. BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at the
  70. beginning of a sequence and returned the matching index starting with 1, or
  71. 0 if no identifier is found.
  72. </p>
  73. <p>
  74. V1.8 equivalent
  75. </p>
  76. <p>
  77. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX)
  78. returns a 2-element tuple where the identifier found is the first tuple element
  79. and the matching index, starting with 0, is the 2nd tuple element. If no identifier
  80. is found both elements of the returned tuple are empty.
  81. </p>
  82. <p>
  83. V1.7
  84. </p>
  85. <p>
  86. BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the
  87. beginning of a sequence and returned the rest of the sequence or emptiness
  88. if no identifier is found.
  89. </p>
  90. <p>
  91. V1.8 equivalent
  92. </p>
  93. <p>
  94. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER)
  95. is the exact equivalent.
  96. </p>
  97. <p>
  98. V1.7
  99. </p>
  100. <p>
  101. BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input begins
  102. with an identifier, else 0 if it does not.
  103. </p>
  104. <p>
  105. V1.8 equivalent
  106. </p>
  107. <p>
  108. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns
  109. the identifier found, otherwise emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER)))
  110. as the exact equivalent.
  111. </p>
  112. <h4>
  113. <a name="variadic_macro_data.vmd_conv.h1"></a>
  114. <span class="phrase"><a name="variadic_macro_data.vmd_conv.number"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.number">Number</a>
  115. </h4>
  116. <p>
  117. V1.7
  118. </p>
  119. <p>
  120. BOOST_VMD_NUMBER(sequence,...) looked for a number at the beginning of a sequence
  121. and returned a 2-element tuple, where the first element is the number and the
  122. second tuple element is the rest of the sequence. If no number is found both
  123. tuple elements are empty.
  124. </p>
  125. <p>
  126. V1.8 equivalent
  127. </p>
  128. <p>
  129. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER) is
  130. the exact equivalent.
  131. </p>
  132. <p>
  133. V1.7
  134. </p>
  135. <p>
  136. BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at the beginning of
  137. a sequence and returned the number if found or emptiness if no number is found.
  138. </p>
  139. <p>
  140. V1.8 equivalent
  141. </p>
  142. <p>
  143. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) is the exact equivalent.
  144. </p>
  145. <p>
  146. V1.7
  147. </p>
  148. <p>
  149. BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the beginning of
  150. a sequence and returned the rest of the sequence or emptiness if no number
  151. is found.
  152. </p>
  153. <p>
  154. V1.8 equivalent
  155. </p>
  156. <p>
  157. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER)
  158. is the exact equivalent.
  159. </p>
  160. <p>
  161. V1.7
  162. </p>
  163. <p>
  164. BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input begins with a number,
  165. else 0 if it does not.
  166. </p>
  167. <p>
  168. V1.8 equivalent
  169. </p>
  170. <p>
  171. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found,
  172. otherwise emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER)))
  173. as the exact equivalent.
  174. </p>
  175. <h4>
  176. <a name="variadic_macro_data.vmd_conv.h2"></a>
  177. <span class="phrase"><a name="variadic_macro_data.vmd_conv.array"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.array">Array</a>
  178. </h4>
  179. <p>
  180. V1.7
  181. </p>
  182. <p>
  183. BOOST_VMD_ARRAY(sequence) looked for an array at the beginning of a sequence
  184. and returned a 2-element tuple, where the first element is the array and the
  185. second tuple element is the rest of the sequence. If no array is found both
  186. tuple elements are empty.
  187. </p>
  188. <p>
  189. V1.8 equivalent
  190. </p>
  191. <p>
  192. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER) is the
  193. exact equivalent.
  194. </p>
  195. <p>
  196. V1.7
  197. </p>
  198. <p>
  199. BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at the beginning of a sequence
  200. and returned the array if found or emptiness if no array is found.
  201. </p>
  202. <p>
  203. V1.8 equivalent
  204. </p>
  205. <p>
  206. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) is the exact equivalent.
  207. </p>
  208. <p>
  209. V1.7
  210. </p>
  211. <p>
  212. BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the beginning of a sequence
  213. and returned the rest of the sequence or emptiness if no array is found.
  214. </p>
  215. <p>
  216. V1.8 equivalent
  217. </p>
  218. <p>
  219. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER)
  220. is the exact equivalent.
  221. </p>
  222. <p>
  223. V1.7
  224. </p>
  225. <p>
  226. BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input begins with an array,
  227. else 0 if it does not.
  228. </p>
  229. <p>
  230. V1.8 equivalent
  231. </p>
  232. <p>
  233. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found, otherwise
  234. emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY)))
  235. as the exact equivalent.
  236. </p>
  237. <h4>
  238. <a name="variadic_macro_data.vmd_conv.h3"></a>
  239. <span class="phrase"><a name="variadic_macro_data.vmd_conv.list"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.list">List</a>
  240. </h4>
  241. <p>
  242. V1.7
  243. </p>
  244. <p>
  245. BOOST_VMD_LIST(sequence) looked for an list at the beginning of a sequence
  246. and returned a 2-element tuple, where the first element is the list and the
  247. second tuple element is the rest of the sequence. If no list is found both
  248. tuple elements are empty.
  249. </p>
  250. <p>
  251. V1.8 equivalent
  252. </p>
  253. <p>
  254. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER) is the
  255. exact equivalent.
  256. </p>
  257. <p>
  258. V1.7
  259. </p>
  260. <p>
  261. BOOST_VMD_BEGIN_LIST(sequence) looked for a list at the beginning of a sequence
  262. and returned the list if found or emptiness if no list is found.
  263. </p>
  264. <p>
  265. V1.8 equivalent
  266. </p>
  267. <p>
  268. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent.
  269. </p>
  270. <p>
  271. V1.7
  272. </p>
  273. <p>
  274. BOOST_VMD_AFTER_LIST(sequence) looked for an list at the beginning of a sequence
  275. and returned the rest of the sequence or emptiness if no list is found.
  276. </p>
  277. <p>
  278. V1.8 equivalent
  279. </p>
  280. <p>
  281. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER)
  282. is the exact equivalent.
  283. </p>
  284. <p>
  285. V1.7
  286. </p>
  287. <p>
  288. BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input begins with an list,
  289. else 0 if it does not.
  290. </p>
  291. <p>
  292. V1.8 equivalent
  293. </p>
  294. <p>
  295. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found, otherwise
  296. emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST)))
  297. as the exact equivalent.
  298. </p>
  299. <h4>
  300. <a name="variadic_macro_data.vmd_conv.h4"></a>
  301. <span class="phrase"><a name="variadic_macro_data.vmd_conv.seq"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.seq">Seq</a>
  302. </h4>
  303. <p>
  304. V1.7
  305. </p>
  306. <p>
  307. BOOST_VMD_SEQ(sequence) looked for a seq at the beginning of a sequence and
  308. returned a 2-element tuple, where the first element is the seq and the second
  309. tuple element is the rest of the sequence. If no seq is found both tuple elements
  310. are empty.
  311. </p>
  312. <p>
  313. V1.8 equivalent
  314. </p>
  315. <p>
  316. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER) is the
  317. exact equivalent.
  318. </p>
  319. <p>
  320. V1.7
  321. </p>
  322. <p>
  323. BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at the beginning of a sequence
  324. and returned the seq if found or emptiness if no seq is found.
  325. </p>
  326. <p>
  327. V1.8 equivalent
  328. </p>
  329. <p>
  330. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent.
  331. </p>
  332. <p>
  333. V1.7
  334. </p>
  335. <p>
  336. BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the beginning of a sequence
  337. and returned the rest of the sequence or emptiness if no seq is found.
  338. </p>
  339. <p>
  340. V1.8 equivalent
  341. </p>
  342. <p>
  343. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER) is
  344. the exact equivalent.
  345. </p>
  346. <p>
  347. V1.7
  348. </p>
  349. <p>
  350. BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input begins with an seq,
  351. else 0 if it does not.
  352. </p>
  353. <p>
  354. V1.8 equivalent
  355. </p>
  356. <p>
  357. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found, otherwise
  358. emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ)))
  359. as the exact equivalent.
  360. </p>
  361. <h4>
  362. <a name="variadic_macro_data.vmd_conv.h5"></a>
  363. <span class="phrase"><a name="variadic_macro_data.vmd_conv.tuple"></a></span><a class="link" href="vmd_conv.html#variadic_macro_data.vmd_conv.tuple">Tuple</a>
  364. </h4>
  365. <p>
  366. V1.7
  367. </p>
  368. <p>
  369. BOOST_VMD_TUPLE(sequence) looked for an tuple at the beginning of a sequence
  370. and returned a 2-element tuple, where the first element is the tuple and the
  371. second tuple element is the rest of the sequence. If no tuple is found both
  372. tuple elements are empty.
  373. </p>
  374. <p>
  375. V1.8 equivalent
  376. </p>
  377. <p>
  378. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER) is the
  379. exact equivalent.
  380. </p>
  381. <p>
  382. V1.7
  383. </p>
  384. <p>
  385. BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at the beginning of a sequence
  386. and returned the tuple if found or emptiness if no tuple is found.
  387. </p>
  388. <p>
  389. V1.8 equivalent
  390. </p>
  391. <p>
  392. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent.
  393. </p>
  394. <p>
  395. V1.7
  396. </p>
  397. <p>
  398. BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the beginning of a sequence
  399. and returned the rest of the sequence or emptiness if no tuple is found.
  400. </p>
  401. <p>
  402. V1.8 equivalent
  403. </p>
  404. <p>
  405. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER)
  406. is the exact equivalent.
  407. </p>
  408. <p>
  409. V1.7
  410. </p>
  411. <p>
  412. BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input begins with an tuple,
  413. else 0 if it does not.
  414. </p>
  415. <p>
  416. V1.8 equivalent
  417. </p>
  418. <p>
  419. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found, otherwise
  420. emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE)))
  421. as the exact equivalent.
  422. </p>
  423. </div>
  424. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  425. <td align="left"></td>
  426. <td align="right"><div class="copyright-footer">Copyright &#169; 2010-2017 Tropic Software
  427. East Inc</div></td>
  428. </tr></table>
  429. <hr>
  430. <div class="spirit-nav">
  431. <a accesskey="p" href="vmd_vc_isms.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_examples.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  432. </div>
  433. </body>
  434. </html>