]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/fusion/container/map/detail/cpp03/as_map.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / fusion / container / map / detail / cpp03 / as_map.hpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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 #ifndef BOOST_PP_IS_ITERATING
8 #if !defined(FUSION_AS_MAP_0932005_1339)
9 #define FUSION_AS_MAP_0932005_1339
10
11 #include <boost/preprocessor/iterate.hpp>
12 #include <boost/preprocessor/repetition/enum_params.hpp>
13 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
14 #include <boost/preprocessor/repetition/repeat.hpp>
15 #include <boost/preprocessor/cat.hpp>
16 #include <boost/preprocessor/inc.hpp>
17 #include <boost/preprocessor/dec.hpp>
18 #include <boost/fusion/container/map/detail/cpp03/map.hpp>
19 #include <boost/fusion/iterator/value_of.hpp>
20 #include <boost/fusion/iterator/deref.hpp>
21 #include <boost/fusion/iterator/next.hpp>
22
23 namespace boost { namespace fusion { namespace detail
24 {
25 BOOST_FUSION_BARRIER_BEGIN
26
27 template <int size, bool is_assoc>
28 struct as_map
29 {
30 BOOST_STATIC_ASSERT_MSG(
31 size <= FUSION_MAX_MAP_SIZE
32 , "FUSION_MAX_MAP_SIZE limit is too low"
33 );
34 };
35
36 template <bool is_assoc>
37 struct as_map<0, is_assoc>
38 {
39 template <typename Iterator>
40 struct apply
41 {
42 typedef map<> type;
43 };
44
45 template <typename Iterator>
46 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
47 static typename apply<Iterator>::type
48 call(Iterator)
49 {
50 return map<>();
51 }
52 };
53
54 BOOST_FUSION_BARRIER_END
55 }}}
56
57 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
58 #include <boost/fusion/container/map/detail/cpp03/preprocessed/as_map.hpp>
59 #else
60 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
61 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/as_map" FUSION_MAX_MAP_SIZE_STR ".hpp")
62 #endif
63
64 /*=============================================================================
65 Copyright (c) 2001-2011 Joel de Guzman
66
67 Distributed under the Boost Software License, Version 1.0. (See accompanying
68 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
69
70 This is an auto-generated file. Do not edit!
71 ==============================================================================*/
72
73 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
74 #pragma wave option(preserve: 1)
75 #endif
76
77 namespace boost { namespace fusion { namespace detail
78 {
79 BOOST_FUSION_BARRIER_BEGIN
80
81 #define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \
82 typedef typename fusion::result_of::next<BOOST_PP_CAT(I, n)>::type \
83 BOOST_PP_CAT(I, BOOST_PP_INC(n));
84
85 #define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \
86 typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \
87 BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n));
88
89 #define BOOST_FUSION_PAIR_FROM_ITERATOR(z, n, data) \
90 typedef pair_from<BOOST_PP_CAT(I, n), is_assoc> BOOST_PP_CAT(D, n); \
91 typedef typename BOOST_PP_CAT(D, n)::type BOOST_PP_CAT(T, n);
92
93 #define BOOST_FUSION_DREF_CALL_ITERATOR(z, n, data) \
94 gen::BOOST_PP_CAT(D, n)::call(BOOST_PP_CAT(i, n))
95
96 #define BOOST_PP_FILENAME_1 <boost/fusion/container/map/detail/cpp03/as_map.hpp>
97 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE)
98 #include BOOST_PP_ITERATE()
99
100 #undef BOOST_FUSION_NEXT_ITERATOR
101 #undef BOOST_FUSION_NEXT_CALL_ITERATOR
102 #undef BOOST_FUSION_PAIR_FROM_ITERATOR
103 #undef BOOST_FUSION_DREF_CALL_ITERATOR
104
105 BOOST_FUSION_BARRIER_END
106 }}}
107
108 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
109 #pragma wave option(output: null)
110 #endif
111
112 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
113
114 #endif
115 #else // defined(BOOST_PP_IS_ITERATING)
116 ///////////////////////////////////////////////////////////////////////////////
117 //
118 // Preprocessor vertical repetition code
119 //
120 ///////////////////////////////////////////////////////////////////////////////
121
122 #define N BOOST_PP_ITERATION()
123
124 template <bool is_assoc>
125 struct as_map<N, is_assoc>
126 {
127 template <typename I0>
128 struct apply
129 {
130 BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_ITERATOR, _)
131 BOOST_PP_REPEAT(N, BOOST_FUSION_PAIR_FROM_ITERATOR, _)
132 typedef map<BOOST_PP_ENUM_PARAMS(N, T)> type;
133 };
134
135 template <typename Iterator>
136 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
137 static typename apply<Iterator>::type
138 call(Iterator const& i0)
139 {
140 typedef apply<Iterator> gen;
141 typedef typename gen::type result;
142 BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _)
143 return result(BOOST_PP_ENUM(N, BOOST_FUSION_DREF_CALL_ITERATOR, _));
144 }
145 };
146
147 #undef N
148 #endif // defined(BOOST_PP_IS_ITERATING)
149