3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Data types</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 1. The Variadic Macro Data Library 1.9">
8 <link rel="up" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.9">
9 <link rel="prev" href="vmd_detail.html" title="Functional groups">
10 <link rel="next" href="vmd_specific.html" title="Specific macros for working with data types">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="vmd_detail.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_specific.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="variadic_macro_data.vmd_data_types"></a><a class="link" href="vmd_data_types.html" title="Data types">Data types</a>
28 </h2></div></div></div>
30 The VMD library has functionality for testing and parsing preprocessor data.
33 The C++ preprocessor defines preprocessor data as preprocessing tokens. The
34 types of preprocessing tokens can be seen in section 2.5 of the C++ standard
38 The VMD library works with a subset of two of these types of preprocessor tokens
39 as "data types". These are the "identifier" and "pp-number"
40 preprocessor tokens. The preprocessor token types which VMD cannot parse are:
42 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
50 user-defined-characteral-literal
56 user-defined-string-literal
59 preprocessing-op-or-punc
63 Even though VMD cannot parse these preprocessor token types, it is still a
64 very useful library since a large part of macro programming works with 'identifier'
65 and 'pp-number' tokens.
68 VMD identifiers are preprocessing tokens consisting of alphanumeric characters
69 and the underscore ( _ ) character. This is very similar to a preprocessor
70 token "identifier" with the difference being that a VMD identifier
71 can start with a numeric character, allowing VMD identifiers to also be positive
72 integral literals. VMD offers functionality for parsing VMD identifiers both
73 as a separate element or in a sequence of preprocessing tokens.
76 VMD numbers are Boost PP numbers, ie. preprocessing tokens of whole numbers
77 between 0 and 256 inclusive. These are a small subset of preprocessor token
78 "pp-number". VMD offers functionality for parsing numbers both as
79 a separate element or in a sequence of preprocessing tokens. A VMD number is
80 really a subset of VMD identifiers for which VMD offers specific functionality.
81 The Boost PP library has it own extensive support for numbers, which VMD does
85 VMD v-types are, like numbers, a subset of VMD identifiers consisting of identifiers
86 beginning with BOOST_VMD_TYPE_ followed by a data type mnemonic. Each v-type
87 can be recognized by VMD functionality and therefore passed or returned by
88 macros. Like any identifier a v-type can be parsed both as a separate element
89 or in a sequence of preprocessing tokens.
92 VMD can also test for emptiness, or the absence of any preprocessing tokens
93 when passed as macro input.
96 The Boost PP library supports four individual high-level data types. These
97 are arrays, lists, seqs, and tuples. When using variadic macros arrays are
98 really obsolete since tuples have all the functionality of arrays with a simpler
99 syntax. Nonetheless arrays are fully supported by VMD. A further data type
100 supported by Boost PP is variadic data, which is a comma separated grouping
101 of preprocessor elements. VMD has no special support for variadic data outside
102 of what is already in Boost PP.
105 VMD has functionality to work with the four Boost PP high-level data types.
106 VMD can test the Boost PP data types and parse them in a sequence of preprocessor
110 VMD can also parse sequences. A sequence consists of zero or more other top-level
111 data types already mentioned represented consecutively. As such a sequence
112 represents any data type which VMD can parse since it can consist of emptiness,
113 a single data type, or multiple data types represented consecutively.
116 Emptiness, the three identifier types, the four Boost PP composite data types,
117 and VMD sequences are the data types which VMD understands. Other low-level
118 preprocessor data types can of course be used in macro programming but VMD
119 cannot parse such preprocessor data.
122 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
123 <td align="left"></td>
124 <td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
128 <div class="spirit-nav">
129 <a accesskey="p" href="vmd_detail.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_specific.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>