|
||||
File indexing completed on 2025-01-18 09:53:38
0001 0002 // (C) Copyright Edward Diener 2011-2015 0003 // Use, modification and distribution are subject to the Boost Software License, 0004 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt). 0006 0007 #if !defined(BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP) 0008 #define BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP 0009 0010 #include <boost/vmd/detail/setup.hpp> 0011 0012 #if BOOST_PP_VARIADICS 0013 0014 /* 0015 0016 The succeeding comments in this file are in doxygen format. 0017 0018 */ 0019 0020 /** \file 0021 */ 0022 0023 /** \def BOOST_VMD_ASSERT_IS_IDENTIFIER(...) 0024 0025 \brief Asserts that the sequence is an identifier. 0026 0027 The macro checks that the sequence is an identifier. 0028 If it is not an identifier, it forces a compiler error. 0029 0030 The macro normally checks for an identifier only in 0031 debug mode. However an end-user can force the macro 0032 to check or not check by defining the macro 0033 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. 0034 0035 ... = variadic parameters 0036 0037 The variadic parameters are: 0038 0039 sequence = A sequence to test as an identifier. <br/> 0040 ids (optional) = The data may take one of two forms: 0041 it is either one or more single identifiers 0042 or a single Boost PP tuple of identifiers. 0043 0044 @code 0045 0046 returns = Normally the macro returns nothing. 0047 0048 If the sequence is an identifier, nothing is 0049 output. If optional ids are specified, for the 0050 sequence to be an identifier it must be an 0051 identifier that matches one of the optional 0052 ids. 0053 0054 For VC++, because there is no sure way of forcing 0055 a compiler error from within a macro without producing 0056 output, if the sequence is not an identifier the 0057 macro forces a compiler error by outputting invalid C++. 0058 0059 For all other compilers a compiler error is forced 0060 without producing output if the sequence is not an 0061 identifier. 0062 0063 @endcode 0064 0065 Identifiers are registered in VMD with: 0066 0067 @code 0068 0069 #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. 0070 0071 @endcode 0072 0073 The identifier must be registered to be found. 0074 0075 Identifiers are pre-detected in VMD with: 0076 0077 @code 0078 0079 #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. 0080 0081 @endcode 0082 0083 If you specify optional ids and have not specified the detection 0084 of an optional id, that id will never match an identifier. 0085 0086 */ 0087 0088 /** \def BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) 0089 0090 \brief Asserts that the sequence is an identifier. Re-entrant version. 0091 0092 The macro checks that the sequence is an identifier. 0093 If it is not an identifier, it forces a compiler error. 0094 0095 The macro normally checks for an identifier only in 0096 debug mode. However an end-user can force the macro 0097 to check or not check by defining the macro 0098 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively. 0099 0100 d = The next available BOOST_PP_WHILE iteration. <br/> 0101 ... = variadic parameters 0102 0103 The variadic parameters are: 0104 0105 sequence = A sequence to test as an identifier. <br/> 0106 ids (optional) = The data may take one of two forms: 0107 it is either one or more single identifiers 0108 or a single Boost PP tuple of identifiers. 0109 0110 @code 0111 0112 returns = Normally the macro returns nothing. 0113 0114 If the sequence is an identifier, nothing is 0115 output. If optional ids are specified, for the 0116 sequence to be an identifier it must be an 0117 identifier that matches one of the optional 0118 ids. 0119 0120 For VC++, because there is no sure way of forcing 0121 a compiler error from within a macro without producing 0122 output, if the sequence is not an identifier the 0123 macro forces a compiler error by outputting invalid C++. 0124 0125 For all other compilers a compiler error is forced 0126 without producing output if the sequence is not an 0127 identifier. 0128 0129 @endcode 0130 0131 Identifiers are registered in VMD with: 0132 0133 @code 0134 0135 #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. 0136 0137 @endcode 0138 0139 The identifier must be registered to be found. 0140 0141 Identifiers are pre-detected in VMD with: 0142 0143 @code 0144 0145 #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. 0146 0147 @endcode 0148 0149 If you specify optional ids and have not specified the detection 0150 of an optional id, that id will never match an identifier. 0151 0152 */ 0153 0154 #if !BOOST_VMD_ASSERT_DATA 0155 0156 #define BOOST_VMD_ASSERT_IS_IDENTIFIER(...) 0157 #define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) 0158 0159 #else 0160 0161 #include <boost/vmd/assert.hpp> 0162 #include <boost/vmd/is_identifier.hpp> 0163 0164 #define BOOST_VMD_ASSERT_IS_IDENTIFIER(...) \ 0165 BOOST_VMD_ASSERT \ 0166 ( \ 0167 BOOST_VMD_IS_IDENTIFIER(__VA_ARGS__), \ 0168 BOOST_VMD_IDENTIFIER_ASSERT_ERROR \ 0169 ) \ 0170 /**/ 0171 0172 #define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) \ 0173 BOOST_VMD_ASSERT \ 0174 ( \ 0175 BOOST_VMD_IS_IDENTIFIER_D(d,__VA_ARGS__), \ 0176 BOOST_VMD_IDENTIFIER_ASSERT_ERROR \ 0177 ) \ 0178 /**/ 0179 0180 #endif // !BOOST_VMD_ASSERT_DATA 0181 #endif /* BOOST_PP_VARIADICS */ 0182 #endif /* BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |