1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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
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>
23 namespace boost { namespace fusion { namespace detail
25 BOOST_FUSION_BARRIER_BEGIN
27 template <int size, bool is_assoc>
30 template <bool is_assoc>
31 struct as_map<0, is_assoc>
33 template <typename Iterator>
39 template <typename Iterator>
40 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
41 static typename apply<Iterator>::type
48 BOOST_FUSION_BARRIER_END
51 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
52 #include <boost/fusion/container/map/detail/cpp03/preprocessed/as_map.hpp>
54 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
55 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/as_map" FUSION_MAX_MAP_SIZE_STR ".hpp")
58 /*=============================================================================
59 Copyright (c) 2001-2011 Joel de Guzman
61 Distributed under the Boost Software License, Version 1.0. (See accompanying
62 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
64 This is an auto-generated file. Do not edit!
65 ==============================================================================*/
67 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
68 #pragma wave option(preserve: 1)
71 namespace boost { namespace fusion { namespace detail
73 BOOST_FUSION_BARRIER_BEGIN
75 #define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \
76 typedef typename fusion::result_of::next<BOOST_PP_CAT(I, n)>::type \
77 BOOST_PP_CAT(I, BOOST_PP_INC(n));
79 #define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \
80 typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \
81 BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n));
83 #define BOOST_FUSION_PAIR_FROM_ITERATOR(z, n, data) \
84 typedef pair_from<BOOST_PP_CAT(I, n), is_assoc> BOOST_PP_CAT(D, n); \
85 typedef typename BOOST_PP_CAT(D, n)::type BOOST_PP_CAT(T, n);
87 #define BOOST_FUSION_DREF_CALL_ITERATOR(z, n, data) \
88 gen::BOOST_PP_CAT(D, n)::call(BOOST_PP_CAT(i, n))
90 #define BOOST_PP_FILENAME_1 <boost/fusion/container/map/detail/cpp03/as_map.hpp>
91 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE)
92 #include BOOST_PP_ITERATE()
94 #undef BOOST_FUSION_NEXT_ITERATOR
95 #undef BOOST_FUSION_NEXT_CALL_ITERATOR
96 #undef BOOST_FUSION_PAIR_FROM_ITERATOR
97 #undef BOOST_FUSION_DREF_CALL_ITERATOR
99 BOOST_FUSION_BARRIER_END
102 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
103 #pragma wave option(output: null)
106 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
109 #else // defined(BOOST_PP_IS_ITERATING)
110 ///////////////////////////////////////////////////////////////////////////////
112 // Preprocessor vertical repetition code
114 ///////////////////////////////////////////////////////////////////////////////
116 #define N BOOST_PP_ITERATION()
118 template <bool is_assoc>
119 struct as_map<N, is_assoc>
121 template <typename I0>
124 BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_ITERATOR, _)
125 BOOST_PP_REPEAT(N, BOOST_FUSION_PAIR_FROM_ITERATOR, _)
126 typedef map<BOOST_PP_ENUM_PARAMS(N, T)> type;
129 template <typename Iterator>
130 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
131 static typename apply<Iterator>::type
132 call(Iterator const& i0)
134 typedef apply<Iterator> gen;
135 typedef typename gen::type result;
136 BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _)
137 return result(BOOST_PP_ENUM(N, BOOST_FUSION_DREF_CALL_ITERATOR, _));
142 #endif // defined(BOOST_PP_IS_ITERATING)