1 | |
2 | // (C) Copyright Edward Diener 2011-2015 |
3 | // Use, modification and distribution are subject to the Boost Software License, |
4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
5 | // http://www.boost.org/LICENSE_1_0.txt). |
6 | |
7 | #if !defined(BOOST_VMD_IS_IDENTIFIER_HPP) |
8 | #define BOOST_VMD_IS_IDENTIFIER_HPP |
9 | |
10 | #include <boost/vmd/detail/setup.hpp> |
11 | |
12 | #if BOOST_PP_VARIADICS |
13 | |
14 | #include <boost/vmd/detail/is_identifier.hpp> |
15 | |
16 | /* |
17 | |
18 | The succeeding comments in this file are in doxygen format. |
19 | |
20 | */ |
21 | |
22 | /** \file |
23 | */ |
24 | |
25 | /** \def BOOST_VMD_IS_IDENTIFIER(...) |
26 | |
27 | \brief Tests whether a parameter is an identifier. |
28 | |
29 | ... = variadic parameters |
30 | |
31 | The first variadic parameter is required and it is the input to test. |
32 | |
33 | Further variadic parameters are optional and are identifiers to match. |
34 | The data may take one of two forms; it is either one or more single identifiers |
35 | or a single Boost PP tuple of identifiers. |
36 | |
37 | returns = 1 if the parameter is an identifier, otherwise 0. |
38 | |
39 | If the parameter is not an identifier, |
40 | or if optional identifiers are specified and the identifier |
41 | does not match any of the optional identifiers, the macro returns 0. |
42 | |
43 | Identifiers are registered in VMD with: |
44 | |
45 | #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. |
46 | |
47 | The identifier must be registered to be found. |
48 | |
49 | Identifiers are pre-detected in VMD with: |
50 | |
51 | #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. |
52 | |
53 | If you specify optional identifiers and have not specified the detection |
54 | of an optional identifier, that optional identifier will never match the input. |
55 | |
56 | If the input is not a VMD data type this macro could lead to |
57 | a preprocessor error. This is because the macro |
58 | uses preprocessor concatenation to determine if the input |
59 | is an identifier once it is determined that the input does not |
60 | start with parenthesis. If the data being concatenated would |
61 | lead to an invalid preprocessor token the compiler can issue |
62 | a preprocessor error. |
63 | |
64 | */ |
65 | |
66 | #define BOOST_VMD_IS_IDENTIFIER(...) \ |
67 | BOOST_VMD_DETAIL_IS_IDENTIFIER(__VA_ARGS__) \ |
68 | /**/ |
69 | |
70 | /** \def BOOST_VMD_IS_IDENTIFIER_D(d,...) |
71 | |
72 | \brief Tests whether a parameter is an identifier. Re-entrant version. |
73 | |
74 | d = The next available BOOST_PP_WHILE iteration. |
75 | ... = variadic parameters |
76 | |
77 | The first variadic parameter is required and it is the input to test. |
78 | |
79 | Further variadic parameters are optional and are identifiers to match. |
80 | The data may take one of two forms; it is either one or more single identifiers |
81 | or a single Boost PP tuple of identifiers. |
82 | |
83 | returns = 1 if the parameter is an identifier, otherwise 0. |
84 | |
85 | If the parameter is not an identifier, |
86 | or if optional identifiers are specified and the identifier |
87 | does not match any of the optional identifiers, the macro returns 0. |
88 | |
89 | Identifiers are registered in VMD with: |
90 | |
91 | #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. |
92 | |
93 | The identifier must be registered to be found. |
94 | |
95 | Identifiers are pre-detected in VMD with: |
96 | |
97 | #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. |
98 | |
99 | If you specify optional identifiers and have not specified the detection |
100 | of an optional identifier, that optional identifier will never match the input. |
101 | |
102 | If the input is not a VMD data type this macro could lead to |
103 | a preprocessor error. This is because the macro |
104 | uses preprocessor concatenation to determine if the input |
105 | is an identifier once it is determined that the input does not |
106 | start with parenthesis. If the data being concatenated would |
107 | lead to an invalid preprocessor token the compiler can issue |
108 | a preprocessor error. |
109 | |
110 | */ |
111 | |
112 | #define BOOST_VMD_IS_IDENTIFIER_D(d,...) \ |
113 | BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,__VA_ARGS__) \ |
114 | /**/ |
115 | |
116 | #endif /* BOOST_PP_VARIADICS */ |
117 | #endif /* BOOST_VMD_IS_IDENTIFIER_HPP */ |
118 | |