vmd_conv17to18.qbk 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. [/
  2. (C) Copyright Edward Diener 2011-2015
  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. [section:vmd_conv Version 1.7 to 1.8 conversion]
  8. Since the current version of VMD has been drastically changed
  9. to make it easier to use VMD functionality this section
  10. details equivalent functionality for previous version 1.7
  11. VMD macros.
  12. The changes in functionality involve the parsing of sequences.
  13. The equivalent to all the V1.7 functionality, which looks for
  14. various data types at the beginning of a sequence, is encompassed
  15. by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...), where '0' is the first
  16. sequence element and 'sequence' is the sequence, with its optional
  17. parameters.
  18. [heading Identifier]
  19. V1.7
  20. BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at
  21. the beginning of a sequence and returned a 2-element tuple, where the first
  22. element is the matching index starting with 1, or 0 if no identifier is found,
  23. and the second tuple element is the rest of the sequence or emptiness if no
  24. identifier is found.
  25. V1.8 equivalent
  26. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX)
  27. returns a 3-element tuple where the identifier found is the first tuple element,
  28. the rest of the sequence is the second tuple element, and the matching index, starting with
  29. 0, is the 3rd tuple element. If no identifier is found all elements of the returned tuple are empty.
  30. V1.7
  31. BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at
  32. the beginning of a sequence and returned the matching index starting with 1, or
  33. 0 if no identifier is found.
  34. V1.8 equivalent
  35. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX)
  36. returns a 2-element tuple where the identifier found is the first tuple element
  37. and the matching index, starting with 0, is the 2nd tuple element. If no identifier
  38. is found both elements of the returned tuple are empty.
  39. V1.7
  40. BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the
  41. beginning of a sequence and returned the rest of the sequence or emptiness if
  42. no identifier is found.
  43. V1.8 equivalent
  44. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER)
  45. is the exact equivalent.
  46. V1.7
  47. BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input
  48. begins with an identifier, else 0 if it does not.
  49. V1.8 equivalent
  50. BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns the identifier found,
  51. otherwise emptiness if not found. You can use
  52. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER)))
  53. as the exact equivalent.
  54. [heading Number]
  55. V1.7
  56. BOOST_VMD_NUMBER(sequence,...) looked for a number at
  57. the beginning of a sequence and returned a 2-element tuple, where the first
  58. element is the number and the second tuple element is the rest of the sequence.
  59. If no number is found both tuple elements are empty.
  60. V1.8 equivalent
  61. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER)
  62. is the exact equivalent.
  63. V1.7
  64. BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at
  65. the beginning of a sequence and returned the number if found or emptiness
  66. if no number is found.
  67. V1.8 equivalent
  68. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER)
  69. is the exact equivalent.
  70. V1.7
  71. BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the
  72. beginning of a sequence and returned the rest of the sequence or emptiness if
  73. no number is found.
  74. V1.8 equivalent
  75. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER)
  76. is the exact equivalent.
  77. V1.7
  78. BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input
  79. begins with a number, else 0 if it does not.
  80. V1.8 equivalent
  81. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found,
  82. otherwise emptiness if not found. You can use
  83. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER)))
  84. as the exact equivalent.
  85. [heading Array]
  86. V1.7
  87. BOOST_VMD_ARRAY(sequence) looked for an array at
  88. the beginning of a sequence and returned a 2-element tuple, where the first
  89. element is the array and the second tuple element is the rest of the sequence.
  90. If no array is found both tuple elements are empty.
  91. V1.8 equivalent
  92. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER)
  93. is the exact equivalent.
  94. V1.7
  95. BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at
  96. the beginning of a sequence and returned the array if found or emptiness
  97. if no array is found.
  98. V1.8 equivalent
  99. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY)
  100. is the exact equivalent.
  101. V1.7
  102. BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the
  103. beginning of a sequence and returned the rest of the sequence or emptiness if
  104. no array is found.
  105. V1.8 equivalent
  106. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER)
  107. is the exact equivalent.
  108. V1.7
  109. BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input
  110. begins with an array, else 0 if it does not.
  111. V1.8 equivalent
  112. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found,
  113. otherwise emptiness if not found. You can use
  114. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY)))
  115. as the exact equivalent.
  116. [heading List]
  117. V1.7
  118. BOOST_VMD_LIST(sequence) looked for an list at
  119. the beginning of a sequence and returned a 2-element tuple, where the first
  120. element is the list and the second tuple element is the rest of the sequence.
  121. If no list is found both tuple elements are empty.
  122. V1.8 equivalent
  123. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER)
  124. is the exact equivalent.
  125. V1.7
  126. BOOST_VMD_BEGIN_LIST(sequence) looked for a list at
  127. the beginning of a sequence and returned the list if found or emptiness
  128. if no list is found.
  129. V1.8 equivalent
  130. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent.
  131. V1.7
  132. BOOST_VMD_AFTER_LIST(sequence) looked for an list at the
  133. beginning of a sequence and returned the rest of the sequence or emptiness if
  134. no list is found.
  135. V1.8 equivalent
  136. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER)
  137. is the exact equivalent.
  138. V1.7
  139. BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input
  140. begins with an list, else 0 if it does not.
  141. V1.8 equivalent
  142. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found,
  143. otherwise emptiness if not found. You can use
  144. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST)))
  145. as the exact equivalent.
  146. [heading Seq]
  147. V1.7
  148. BOOST_VMD_SEQ(sequence) looked for a seq at
  149. the beginning of a sequence and returned a 2-element tuple, where the first
  150. element is the seq and the second tuple element is the rest of the sequence.
  151. If no seq is found both tuple elements are empty.
  152. V1.8 equivalent
  153. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER)
  154. is the exact equivalent.
  155. V1.7
  156. BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at
  157. the beginning of a sequence and returned the seq if found or emptiness
  158. if no seq is found.
  159. V1.8 equivalent
  160. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent.
  161. V1.7
  162. BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the
  163. beginning of a sequence and returned the rest of the sequence or emptiness if
  164. no seq is found.
  165. V1.8 equivalent
  166. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER)
  167. is the exact equivalent.
  168. V1.7
  169. BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input
  170. begins with an seq, else 0 if it does not.
  171. V1.8 equivalent
  172. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found,
  173. otherwise emptiness if not found. You can use
  174. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ)))
  175. as the exact equivalent.
  176. [heading Tuple]
  177. V1.7
  178. BOOST_VMD_TUPLE(sequence) looked for an tuple at
  179. the beginning of a sequence and returned a 2-element tuple, where the first
  180. element is the tuple and the second tuple element is the rest of the sequence.
  181. If no tuple is found both tuple elements are empty.
  182. V1.8 equivalent
  183. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER)
  184. is the exact equivalent.
  185. V1.7
  186. BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at
  187. the beginning of a sequence and returned the tuple if found or emptiness
  188. if no tuple is found.
  189. V1.8 equivalent
  190. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent.
  191. V1.7
  192. BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the
  193. beginning of a sequence and returned the rest of the sequence or emptiness if
  194. no tuple is found.
  195. V1.8 equivalent
  196. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER)
  197. is the exact equivalent.
  198. V1.7
  199. BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input
  200. begins with an tuple, else 0 if it does not.
  201. V1.8 equivalent
  202. BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found,
  203. otherwise emptiness if not found. You can use
  204. BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE)))
  205. as the exact equivalent.
  206. [endsect]