File indexing completed on 2025-01-18 09:31:07
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
0009 #define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
0010
0011 #include <boost/config.hpp>
0012
0013 #include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
0014 #include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp>
0015
0016 #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
0017
0018 #include <boost/preprocessor/arithmetic/dec.hpp>
0019 #include <boost/preprocessor/control/iif.hpp>
0020 #include <boost/preprocessor/logical/or.hpp>
0021 #include <boost/preprocessor/tuple/elem.hpp>
0022 #include <boost/preprocessor/variadic/to_seq.hpp>
0023 #include <boost/preprocessor/variadic/size.hpp>
0024 #include <boost/preprocessor/variadic/elem.hpp>
0025 #include <boost/preprocessor/seq/seq.hpp>
0026 #include <boost/preprocessor/seq/rest_n.hpp>
0027
0028
0029 #define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \
0030 BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)
0031
0032 #define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE) \
0033 BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)
0034
0035 #if BOOST_PP_VARIADICS
0036
0037 # define BOOST_FUSION_ADAPT_ADT_FILLER_0(...) \
0038 BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \
0039 BOOST_FUSION_ADAPT_ADT_FILLER_1
0040
0041 # define BOOST_FUSION_ADAPT_ADT_FILLER_1(...) \
0042 BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \
0043 BOOST_FUSION_ADAPT_ADT_FILLER_0
0044
0045 # define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
0046 # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
0047
0048
0049 # define BOOST_FUSION_ADAPT_ADT_FILLER(...) \
0050 BOOST_PP_IIF( \
0051 BOOST_PP_OR( \
0052 BOOST_MPL_PP_TOKEN_EQUAL(auto, \
0053 BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
0054 BOOST_MPL_PP_TOKEN_EQUAL(auto, \
0055 BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \
0056 \
0057 BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \
0058 BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \
0059 BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \
0060 ), \
0061 BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(__VA_ARGS__))
0062
0063 # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(...) \
0064 ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__)))
0065
0066 # define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \
0067 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \
0068 BOOST_PP_DEC(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)), \
0069 BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)))
0070
0071 #else
0072
0073 # define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D) \
0074 BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \
0075 BOOST_FUSION_ADAPT_ADT_FILLER_1
0076
0077 # define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D) \
0078 BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \
0079 BOOST_FUSION_ADAPT_ADT_FILLER_0
0080
0081 # define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
0082 # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
0083
0084 # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \
0085 BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \
0086 ((2, (C,D))), \
0087 ((4, (A,B,C,D))) \
0088 )
0089
0090 #endif
0091
0092 #endif