File indexing completed on 2025-01-18 09:53:36
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_VMD_DETAIL_IS_IDENTIFIER_HPP)
0008 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_HPP
0009
0010 #include <boost/preprocessor/comparison/equal.hpp>
0011 #include <boost/preprocessor/control/iif.hpp>
0012 #include <boost/preprocessor/logical/bitor.hpp>
0013 #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
0014 #include <boost/preprocessor/tuple/elem.hpp>
0015 #include <boost/preprocessor/variadic/size.hpp>
0016 #include <boost/preprocessor/variadic/elem.hpp>
0017 #include <boost/vmd/identity.hpp>
0018 #include <boost/vmd/is_empty.hpp>
0019 #include <boost/vmd/is_tuple.hpp>
0020 #include <boost/vmd/detail/identifier.hpp>
0021 #include <boost/vmd/detail/identifier_concat.hpp>
0022 #include <boost/vmd/detail/not_empty.hpp>
0023
0024 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_MATCH(tup) \
0025 BOOST_VMD_DETAIL_NOT_EMPTY \
0026 ( \
0027 BOOST_PP_TUPLE_ELEM(0,tup) \
0028 ) \
0029
0030
0031 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_TUPLE(ptup) \
0032 BOOST_VMD_IDENTITY_RESULT \
0033 ( \
0034 BOOST_PP_IIF \
0035 ( \
0036 BOOST_VMD_IS_TUPLE(ptup), \
0037 BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_MATCH, \
0038 BOOST_VMD_IDENTITY(0) \
0039 ) \
0040 (ptup) \
0041 ) \
0042
0043
0044 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_ID(vseq) \
0045 BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_TUPLE \
0046 ( \
0047 BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq) \
0048 ) \
0049
0050
0051 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(vseq) \
0052 BOOST_VMD_IDENTITY_RESULT \
0053 ( \
0054 BOOST_PP_IIF \
0055 ( \
0056 BOOST_PP_BITOR \
0057 ( \
0058 BOOST_VMD_IS_EMPTY(vseq), \
0059 BOOST_PP_IS_BEGIN_PARENS(vseq) \
0060 ), \
0061 BOOST_VMD_IDENTITY(0), \
0062 BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ_ID \
0063 ) \
0064 (vseq) \
0065 ) \
0066
0067
0068 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE(...) \
0069 BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
0070
0071
0072 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE_D(d,...) \
0073 BOOST_VMD_DETAIL_IS_IDENTIFIER_VSEQ(BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
0074
0075
0076 #define BOOST_VMD_DETAIL_IS_IDENTIFIER(...) \
0077 BOOST_PP_IIF \
0078 ( \
0079 BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),1), \
0080 BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE, \
0081 BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE \
0082 ) \
0083 (__VA_ARGS__) \
0084
0085
0086 #define BOOST_VMD_DETAIL_IS_IDENTIFIER_D(d,...) \
0087 BOOST_PP_IIF \
0088 ( \
0089 BOOST_PP_EQUAL_D(d,BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),1), \
0090 BOOST_VMD_DETAIL_IS_IDENTIFIER_SINGLE_D, \
0091 BOOST_VMD_DETAIL_IS_IDENTIFIER_MULTIPLE_D \
0092 ) \
0093 (d,__VA_ARGS__) \
0094
0095
0096 #endif