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