]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / fusion / adapted / adt / detail / adapt_base_assoc_attr_filler.hpp
1 /*=============================================================================
2 Copyright (c) 2013-2014 Damien Buhl
3
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7
8 #ifndef BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
9 #define BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
10
11 #include <boost/config.hpp>
12
13 #include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
14 #include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
15
16 #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
17
18 #include <boost/preprocessor/config/config.hpp>
19 #include <boost/preprocessor/control/iif.hpp>
20 #include <boost/preprocessor/variadic/size.hpp>
21 #include <boost/preprocessor/arithmetic/dec.hpp>
22
23 #if BOOST_PP_VARIADICS
24
25 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(...) \
26 BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \
27 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1
28
29 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(...) \
30 BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \
31 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
32
33 #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(...) \
34 ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__)))
35
36 #else // BOOST_PP_VARIADICS
37
38 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E) \
39 BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
40 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1
41
42 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E) \
43 BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
44 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
45
46 #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
47 BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \
48 ((3, (C,D,E))), \
49 ((5, (A,B,C,D,E))) \
50 )
51
52 #endif // BOOST_PP_VARIADICS
53
54 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END
55 #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END
56
57
58 #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
59 BOOST_PP_TUPLE_ELEM( \
60 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
61 BOOST_PP_DEC(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \
62 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE))
63
64 #endif