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).
7 #if !defined(BOOST_VMD_IS_IDENTIFIER_HPP)
8 #define BOOST_VMD_IS_IDENTIFIER_HPP
10 #include <boost/vmd/detail/setup.hpp>
12 #if BOOST_PP_VARIADICS
14 #include <boost/vmd/detail/is_identifier.hpp>
18 The succeeding comments in this file are in doxygen format.
25 /** \def BOOST_VMD_IS_IDENTIFIER(...)
27 \brief Tests whether a parameter is an identifier.
29 ... = variadic parameters
31 The first variadic parameter is required and it is the input to test.
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.
37 returns = 1 if the parameter is an identifier, otherwise 0.
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.
43 Identifiers are registered in VMD with:
45 #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
47 The identifier must be registered to be found.
49 Identifiers are pre-detected in VMD with:
51 #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
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.
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
66 #define BOOST_VMD_IS_IDENTIFIER(...) \
67 BOOST_VMD_DETAIL_IS_IDENTIFIER(__VA_ARGS__) \
70 /** \def BOOST_VMD_IS_IDENTIFIER_D(d,...)
72 \brief Tests whether a parameter is an identifier. Re-entrant version.
74 d = The next available BOOST_PP_WHILE iteration.
75 ... = variadic parameters
77 The first variadic parameter is required and it is the input to test.
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.
83 returns = 1 if the parameter is an identifier, otherwise 0.
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.
89 Identifiers are registered in VMD with:
91 #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
93 The identifier must be registered to be found.
95 Identifiers are pre-detected in VMD with:
97 #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
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.
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.
112 #define BOOST_VMD_IS_IDENTIFIER_D(d,...) \
113 BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,__VA_ARGS__) \
116 #endif /* BOOST_PP_VARIADICS */
117 #endif /* BOOST_VMD_IS_IDENTIFIER_HPP */