File indexing completed on 2025-01-18 09:31:08
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
0009 #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_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/adapt_base_attr_filler.hpp>
0015
0016 #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
0017
0018 #include <boost/preprocessor/config/config.hpp>
0019 #include <boost/preprocessor/control/iif.hpp>
0020 #include <boost/preprocessor/arithmetic/dec.hpp>
0021 #include <boost/preprocessor/variadic/size.hpp>
0022 #include <boost/preprocessor/variadic/elem.hpp>
0023
0024 #if BOOST_PP_VARIADICS
0025
0026 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(...) \
0027 BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \
0028 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
0029
0030 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(...) \
0031 BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \
0032 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
0033
0034 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \
0035 BOOST_PP_IIF( \
0036 BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
0037 ((2, \
0038 (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__), \
0039 BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__)))), \
0040 ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \
0041 (__VA_ARGS__))) \
0042 )
0043
0044 #else
0045
0046
0047 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
0048 BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
0049 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
0050
0051 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
0052 BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
0053 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
0054
0055 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
0056 BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, X), \
0057 ((2, (Y,Z))), \
0058 ((3, (X,Y,Z))) \
0059 )
0060
0061 #endif
0062
0063 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
0064 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
0065
0066
0067 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
0068 BOOST_PP_TUPLE_ELEM( \
0069 BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
0070 BOOST_PP_DEC(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \
0071 BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE))
0072
0073 #endif