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   @code
38 
39     returns   = 1 if the parameter is an identifier, otherwise 0.
40 
41                 If the parameter is not an identifier,
42                 or if optional identifiers are specified and the identifier
43                 does not match any of the optional identifiers, the macro returns 0.
44 
45   @endcode
46 
47     Identifiers are registered in VMD with:
48 
49   @code
50 
51         #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
52 
53   @endcode
54 
55     The identifier must be registered to be found.
56 
57     Identifiers are pre-detected in VMD with:
58 
59   @code
60 
61         #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
62 
63   @endcode
64 
65     If you specify optional identifiers and have not specified the detection
66     of an optional identifier, that optional identifier will never match the input.
67 
68     If the input is not a VMD data type this macro could lead to
69     a preprocessor error. This is because the macro
70     uses preprocessor concatenation to determine if the input
71     is an identifier once it is determined that the input does not
72     start with parenthesis. If the data being concatenated would
73     lead to an invalid preprocessor token the compiler can issue
74     a preprocessor error.
75 
76 */
77 
78 #define BOOST_VMD_IS_IDENTIFIER(...) \
79     BOOST_VMD_DETAIL_IS_IDENTIFIER(__VA_ARGS__) \
80 /**/
81 
82 /** \def BOOST_VMD_IS_IDENTIFIER_D(d,...)
83 
84     \brief Tests whether a parameter is an identifier. Re-entrant version.
85 
86     d         = The next available BOOST_PP_WHILE iteration. <br/>
87     ...       = variadic parameters
88 
89     The first variadic parameter is required and it is the input to test.
90 
91     Further variadic parameters are optional and are identifiers to match.
92     The data may take one of two forms; it is either one or more single identifiers
93     or a single Boost PP tuple of identifiers.
94 
95   @code
96 
97     returns   = 1 if the parameter is an identifier, otherwise 0.
98 
99                 If the parameter is not an identifier,
100                 or if optional identifiers are specified and the identifier
101                 does not match any of the optional identifiers, the macro returns 0.
102 
103   @endcode
104 
105     Identifiers are registered in VMD with:
106 
107   @code
108 
109         #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
110 
111   @endcode
112 
113     The identifier must be registered to be found.
114 
115     Identifiers are pre-detected in VMD with:
116 
117   @code
118 
119         #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
120 
121   @endcode
122 
123     If you specify optional identifiers and have not specified the detection
124     of an optional identifier, that optional identifier will never match the input.
125 
126     If the input is not a VMD data type this macro could lead to
127     a preprocessor error. This is because the macro
128     uses preprocessor concatenation to determine if the input
129     is an identifier once it is determined that the input does not
130     start with parenthesis. If the data being concatenated would
131     lead to an invalid preprocessor token the compiler can issue
132     a preprocessor error.
133 
134 */
135 
136 #define BOOST_VMD_IS_IDENTIFIER_D(d,...) \
137     BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,__VA_ARGS__) \
138 /**/
139 
140 #endif /* BOOST_PP_VARIADICS */
141 #endif /* BOOST_VMD_IS_IDENTIFIER_HPP */
142