]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | [section:vmd_conv Version 1.7 to 1.8 conversion] | |
9 | ||
10 | Since the current version of VMD has been drastically changed | |
11 | to make it easier to use VMD functionality this section | |
12 | details equivalent functionality for previous version 1.7 | |
13 | VMD macros. | |
14 | ||
15 | The changes in functionality involve the parsing of sequences. | |
16 | The equivalent to all the V1.7 functionality, which looks for | |
17 | various data types at the beginning of a sequence, is encompassed | |
18 | by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...), where '0' is the first | |
19 | sequence element and 'sequence' is the sequence, with its optional | |
20 | parameters. | |
21 | ||
22 | [heading Identifier] | |
23 | ||
24 | V1.7 | |
25 | ||
26 | BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at | |
27 | the beginning of a sequence and returned a 2-element tuple, where the first | |
28 | element is the matching index starting with 1, or 0 if no identifier is found, | |
29 | and the second tuple element is the rest of the sequence or emptiness if no | |
30 | identifier is found. | |
31 | ||
32 | V1.8 equivalent | |
33 | ||
34 | BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX) | |
35 | returns a 3-element tuple where the identifier found is the first tuple element, | |
36 | the rest of the sequence is the second tuple element, and the matching index, starting with | |
37 | 0, is the 3rd tuple element. If no identifier is found all elements of the returned tuple are empty. | |
38 | ||
39 | V1.7 | |
40 | ||
41 | BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at | |
42 | the beginning of a sequence and returned the matching index starting with 1, or | |
43 | 0 if no identifier is found. | |
44 | ||
45 | V1.8 equivalent | |
46 | ||
47 | BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX) | |
48 | returns a 2-element tuple where the identifier found is the first tuple element | |
49 | and the matching index, starting with 0, is the 2nd tuple element. If no identifier | |
50 | is found both elements of the returned tuple are empty. | |
51 | ||
52 | V1.7 | |
53 | ||
54 | BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the | |
55 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
56 | no identifier is found. | |
57 | ||
58 | V1.8 equivalent | |
59 | ||
60 | BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER) | |
61 | is the exact equivalent. | |
62 | ||
63 | V1.7 | |
64 | ||
65 | BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input | |
66 | begins with an identifier, else 0 if it does not. | |
67 | ||
68 | V1.8 equivalent | |
69 | ||
70 | BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns the identifier found, | |
71 | otherwise emptiness if not found. You can use | |
72 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER))) | |
73 | as the exact equivalent. | |
74 | ||
75 | [heading Number] | |
76 | ||
77 | V1.7 | |
78 | ||
79 | BOOST_VMD_NUMBER(sequence,...) looked for a number at | |
80 | the beginning of a sequence and returned a 2-element tuple, where the first | |
81 | element is the number and the second tuple element is the rest of the sequence. | |
82 | If no number is found both tuple elements are empty. | |
83 | ||
84 | V1.8 equivalent | |
85 | ||
86 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER) | |
87 | is the exact equivalent. | |
88 | ||
89 | V1.7 | |
90 | ||
91 | BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at | |
92 | the beginning of a sequence and returned the number if found or emptiness | |
93 | if no number is found. | |
94 | ||
95 | V1.8 equivalent | |
96 | ||
97 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) | |
98 | is the exact equivalent. | |
99 | ||
100 | V1.7 | |
101 | ||
102 | BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the | |
103 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
104 | no number is found. | |
105 | ||
106 | V1.8 equivalent | |
107 | ||
108 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER) | |
109 | is the exact equivalent. | |
110 | ||
111 | V1.7 | |
112 | ||
113 | BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input | |
114 | begins with a number, else 0 if it does not. | |
115 | ||
116 | V1.8 equivalent | |
117 | ||
118 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found, | |
119 | otherwise emptiness if not found. You can use | |
120 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER))) | |
121 | as the exact equivalent. | |
122 | ||
123 | [heading Array] | |
124 | ||
125 | V1.7 | |
126 | ||
127 | BOOST_VMD_ARRAY(sequence) looked for an array at | |
128 | the beginning of a sequence and returned a 2-element tuple, where the first | |
129 | element is the array and the second tuple element is the rest of the sequence. | |
130 | If no array is found both tuple elements are empty. | |
131 | ||
132 | V1.8 equivalent | |
133 | ||
134 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER) | |
135 | is the exact equivalent. | |
136 | ||
137 | V1.7 | |
138 | ||
139 | BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at | |
140 | the beginning of a sequence and returned the array if found or emptiness | |
141 | if no array is found. | |
142 | ||
143 | V1.8 equivalent | |
144 | ||
145 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) | |
146 | is the exact equivalent. | |
147 | ||
148 | V1.7 | |
149 | ||
150 | BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the | |
151 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
152 | no array is found. | |
153 | ||
154 | V1.8 equivalent | |
155 | ||
156 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER) | |
157 | is the exact equivalent. | |
158 | ||
159 | V1.7 | |
160 | ||
161 | BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input | |
162 | begins with an array, else 0 if it does not. | |
163 | ||
164 | V1.8 equivalent | |
165 | ||
166 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found, | |
167 | otherwise emptiness if not found. You can use | |
168 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY))) | |
169 | as the exact equivalent. | |
170 | ||
171 | [heading List] | |
172 | ||
173 | V1.7 | |
174 | ||
175 | BOOST_VMD_LIST(sequence) looked for an list at | |
176 | the beginning of a sequence and returned a 2-element tuple, where the first | |
177 | element is the list and the second tuple element is the rest of the sequence. | |
178 | If no list is found both tuple elements are empty. | |
179 | ||
180 | V1.8 equivalent | |
181 | ||
182 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER) | |
183 | is the exact equivalent. | |
184 | ||
185 | V1.7 | |
186 | ||
187 | BOOST_VMD_BEGIN_LIST(sequence) looked for a list at | |
188 | the beginning of a sequence and returned the list if found or emptiness | |
189 | if no list is found. | |
190 | ||
191 | V1.8 equivalent | |
192 | ||
193 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent. | |
194 | ||
195 | V1.7 | |
196 | ||
197 | BOOST_VMD_AFTER_LIST(sequence) looked for an list at the | |
198 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
199 | no list is found. | |
200 | ||
201 | V1.8 equivalent | |
202 | ||
203 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER) | |
204 | is the exact equivalent. | |
205 | ||
206 | V1.7 | |
207 | ||
208 | BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input | |
209 | begins with an list, else 0 if it does not. | |
210 | ||
211 | V1.8 equivalent | |
212 | ||
213 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found, | |
214 | otherwise emptiness if not found. You can use | |
215 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST))) | |
216 | as the exact equivalent. | |
217 | ||
218 | [heading Seq] | |
219 | ||
220 | V1.7 | |
221 | ||
222 | BOOST_VMD_SEQ(sequence) looked for a seq at | |
223 | the beginning of a sequence and returned a 2-element tuple, where the first | |
224 | element is the seq and the second tuple element is the rest of the sequence. | |
225 | If no seq is found both tuple elements are empty. | |
226 | ||
227 | V1.8 equivalent | |
228 | ||
229 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER) | |
230 | is the exact equivalent. | |
231 | ||
232 | V1.7 | |
233 | ||
234 | BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at | |
235 | the beginning of a sequence and returned the seq if found or emptiness | |
236 | if no seq is found. | |
237 | ||
238 | V1.8 equivalent | |
239 | ||
240 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent. | |
241 | ||
242 | V1.7 | |
243 | ||
244 | BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the | |
245 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
246 | no seq is found. | |
247 | ||
248 | V1.8 equivalent | |
249 | ||
250 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER) | |
251 | is the exact equivalent. | |
252 | ||
253 | V1.7 | |
254 | ||
255 | BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input | |
256 | begins with an seq, else 0 if it does not. | |
257 | ||
258 | V1.8 equivalent | |
259 | ||
260 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found, | |
261 | otherwise emptiness if not found. You can use | |
262 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ))) | |
263 | as the exact equivalent. | |
264 | ||
265 | [heading Tuple] | |
266 | ||
267 | V1.7 | |
268 | ||
269 | BOOST_VMD_TUPLE(sequence) looked for an tuple at | |
270 | the beginning of a sequence and returned a 2-element tuple, where the first | |
271 | element is the tuple and the second tuple element is the rest of the sequence. | |
272 | If no tuple is found both tuple elements are empty. | |
273 | ||
274 | V1.8 equivalent | |
275 | ||
276 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER) | |
277 | is the exact equivalent. | |
278 | ||
279 | V1.7 | |
280 | ||
281 | BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at | |
282 | the beginning of a sequence and returned the tuple if found or emptiness | |
283 | if no tuple is found. | |
284 | ||
285 | V1.8 equivalent | |
286 | ||
287 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent. | |
288 | ||
289 | V1.7 | |
290 | ||
291 | BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the | |
292 | beginning of a sequence and returned the rest of the sequence or emptiness if | |
293 | no tuple is found. | |
294 | ||
295 | V1.8 equivalent | |
296 | ||
297 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER) | |
298 | is the exact equivalent. | |
299 | ||
300 | V1.7 | |
301 | ||
302 | BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input | |
303 | begins with an tuple, else 0 if it does not. | |
304 | ||
305 | V1.8 equivalent | |
306 | ||
307 | BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found, | |
308 | otherwise emptiness if not found. You can use | |
309 | BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE))) | |
310 | as the exact equivalent. | |
311 | ||
312 | [endsect] |