]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/vmd/doc/vmd_data_types.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / vmd / doc / vmd_data_types.qbk
CommitLineData
7c673cae
FG
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_data_types Data types]
9
10The VMD library has functionality for testing and parsing preprocessor data.
11
12The C++ preprocessor defines preprocessor data as preprocessing tokens.
13The types of preprocessing tokens can be seen in section 2.5 of the C++ standard document.
14
15The VMD library works with a subset of two of these types of preprocessor tokens
16as "data types". These are the "identifier" and "pp-number" preprocessor tokens.
17The preprocessor token types which VMD cannot parse are:
18
19* header-name
20* character-literal
21* user-defined-characteral-literal
22* string-literal
23* user-defined-string-literal
24* preprocessing-op-or-punc
25
26Even though VMD cannot parse these preprocessor token types, it is still
27a very useful library since a large part of macro programming works with
28'identifier' and 'pp-number' tokens.
29
30VMD identifiers are preprocessing tokens consisting
31of alphanumeric characters and the underscore ( _ ) character. This is very similar to a
32preprocessor token "identifier" with the difference being that a VMD identifier can start with a
33numeric character, allowing VMD identifiers to also be positive integral literals. VMD offers
34functionality for parsing VMD identifiers both as a separate element or in a sequence of preprocessing
35tokens.
36
37VMD numbers are Boost PP numbers, ie. preprocessing tokens of
38whole numbers between 0 and 256 inclusive. These are a small subset of preprocessor token
39"pp-number". VMD offers functionality for parsing numbers both as a separate element or
40in a sequence of preprocessing tokens. A VMD number is really a subset of VMD identifiers
41for which VMD offers specific functionality. The Boost PP library has it own extensive support
42for numbers, which VMD does not duplicate.
43
44VMD v-types are, like numbers, a subset of VMD identifiers consisting of identifiers beginning with
45BOOST_VMD_TYPE_ followed by a data type mnemonic. Each v-type can be recognized by VMD functionality
46and therefore passed or returned by macros. Like any identifier a v-type can be parsed both as a
47separate element or in a sequence of preprocessing tokens.
48
49VMD can also test for emptiness, or the absence of any preprocessing tokens when passed
50as macro input.
51
52The Boost PP library supports four individual high-level data types. These are arrays,
53lists, seqs, and tuples. When using variadic macros arrays are really
54obsolete since tuples have all the functionality of arrays with a simpler syntax.
55Nonetheless arrays are fully supported by VMD. A further data type supported by
56Boost PP is variadic data, which is a comma separated grouping of preprocessor elements.
57VMD has no special support for variadic data outside of what is already in Boost PP.
58
59VMD has functionality to work with the four Boost PP high-level data types. VMD can
60test the Boost PP data types and parse them in a sequence of preprocessor tokens.
61
62VMD can also parse sequences. A sequence consists of zero or more other top-level
63data types already mentioned represented consecutively. As such a sequence represents
64any data type which VMD can parse since it can consist of emptiness, a single data type,
65or multiple data types represented consecutively.
66
67Emptiness, the three identifier types, the four Boost PP composite data types, and
68VMD sequences are the data types which VMD understands. Other low-level preprocessor
69data types can of course be used in macro programming but VMD cannot parse such
70preprocessor data.
71
72[endsect]