Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:31:08

0001 /*=============================================================================
0002     Copyright (c) 2013-2014 Damien Buhl
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
0009 #define BOOST_FUSION_ADAPTED_STRUCT_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/config/config.hpp>
0019 #include <boost/preprocessor/control/iif.hpp>
0020 #include <boost/preprocessor/control/expr_iif.hpp>
0021 #include <boost/preprocessor/logical/compl.hpp>
0022 #include <boost/preprocessor/tuple/elem.hpp>
0023 #include <boost/preprocessor/seq/for_each.hpp>
0024 #include <boost/preprocessor/seq/push_front.hpp>
0025 #include <boost/preprocessor/facilities/expand.hpp>
0026 #include <boost/preprocessor/facilities/is_empty.hpp>
0027 
0028 
0029 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y)                                \
0030     BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y)                                    \
0031     BOOST_FUSION_ADAPT_STRUCT_FILLER_1
0032 
0033 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y)                                \
0034     BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y)                                    \
0035     BOOST_FUSION_ADAPT_STRUCT_FILLER_0
0036 
0037 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
0038 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
0039 
0040 #define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y)                               \
0041     BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_EXPAND(X)),            \
0042       ((1, (Y))),                                                               \
0043       ((2, (X,Y)))                                                              \
0044     )
0045 
0046 #define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE)                   \
0047   BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)
0048 
0049 #define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)                        \
0050   BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)
0051 
0052 
0053 #if BOOST_PP_VARIADICS
0054 
0055 #   define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem)      \
0056         BOOST_PP_IIF(BOOST_FUSION_PP_IS_SEQ(elem),                              \
0057             BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END),        \
0058             BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(BOOST_PP_IS_EMPTY(elem)),          \
0059                 BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto, elem)))
0060 
0061 #   define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ)             \
0062         BOOST_PP_SEQ_PUSH_FRONT(                                                \
0063             BOOST_PP_SEQ_FOR_EACH(                                              \
0064                 BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP,                 \
0065                 unused, VA_ARGS_SEQ),                                           \
0066             (0,0))
0067 
0068 #endif // BOOST_PP_VARIADICS
0069 
0070 #endif