]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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_VECTOR_09222005_0950) | |
9 | #define FUSION_AS_VECTOR_09222005_0950 | |
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/vector/vector.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> | |
28 | struct as_vector; | |
29 | ||
30 | template <> | |
31 | struct as_vector<0> | |
32 | { | |
33 | template <typename Iterator> | |
34 | struct apply | |
35 | { | |
36 | typedef vector0<> type; | |
37 | }; | |
38 | ||
39 | template <typename Iterator> | |
40 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
41 | static typename apply<Iterator>::type | |
42 | call(Iterator) | |
43 | { | |
44 | return vector0<>(); | |
45 | } | |
46 | }; | |
47 | ||
48 | BOOST_FUSION_BARRIER_END | |
49 | }}} | |
50 | ||
51 | #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) | |
52 | #include <boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector.hpp> | |
53 | #else | |
54 | #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
55 | #pragma wave option(preserve: 2, line: 0, output: "preprocessed/as_vector" FUSION_MAX_VECTOR_SIZE_STR ".hpp") | |
56 | #endif | |
57 | ||
58 | /*============================================================================= | |
59 | Copyright (c) 2001-2011 Joel de Guzman | |
60 | ||
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) | |
63 | ||
64 | This is an auto-generated file. Do not edit! | |
65 | ==============================================================================*/ | |
66 | ||
67 | #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
68 | #pragma wave option(preserve: 1) | |
69 | #endif | |
70 | ||
71 | namespace boost { namespace fusion { namespace detail | |
72 | { | |
73 | BOOST_FUSION_BARRIER_BEGIN | |
74 | ||
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)); | |
78 | ||
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)); | |
82 | ||
83 | #define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \ | |
84 | typedef typename fusion::result_of::value_of<BOOST_PP_CAT(I, n)>::type \ | |
85 | BOOST_PP_CAT(T, n); | |
86 | ||
87 | #define BOOST_PP_FILENAME_1 <boost/fusion/container/vector/detail/cpp03/as_vector.hpp> | |
88 | #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) | |
89 | #include BOOST_PP_ITERATE() | |
90 | ||
91 | #undef BOOST_FUSION_NEXT_ITERATOR | |
92 | #undef BOOST_FUSION_NEXT_CALL_ITERATOR | |
93 | #undef BOOST_FUSION_VALUE_OF_ITERATOR | |
94 | ||
95 | BOOST_FUSION_BARRIER_END | |
96 | }}} | |
97 | ||
98 | #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) | |
99 | #pragma wave option(output: null) | |
100 | #endif | |
101 | ||
102 | #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES | |
103 | ||
104 | #endif | |
105 | #else // defined(BOOST_PP_IS_ITERATING) | |
106 | /////////////////////////////////////////////////////////////////////////////// | |
107 | // | |
108 | // Preprocessor vertical repetition code | |
109 | // | |
110 | /////////////////////////////////////////////////////////////////////////////// | |
111 | ||
112 | #define N BOOST_PP_ITERATION() | |
113 | ||
114 | template <> | |
115 | struct as_vector<N> | |
116 | { | |
117 | template <typename I0> | |
118 | struct apply | |
119 | { | |
120 | BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _) | |
121 | BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _) | |
122 | typedef BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, T)> type; | |
123 | }; | |
124 | ||
125 | template <typename Iterator> | |
126 | BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
127 | static typename apply<Iterator>::type | |
128 | call(Iterator const& i0) | |
129 | { | |
130 | typedef apply<Iterator> gen; | |
131 | typedef typename gen::type result; | |
132 | BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _) | |
133 | return result(BOOST_PP_ENUM_PARAMS(N, *i)); | |
134 | } | |
135 | }; | |
136 | ||
137 | #undef N | |
138 | #endif // defined(BOOST_PP_IS_ITERATING) | |
139 |