1 /*=============================================================================
2 Copyright (c) 2005-2012 Joel de Guzman
3 Copyright (c) 2006 Dan Marsden
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
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>
24 namespace boost { namespace fusion { namespace detail
32 template <typename Iterator>
38 template <typename Iterator>
39 BOOST_FUSION_GPU_ENABLED
40 static typename apply<Iterator>::type
48 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
49 #include <boost/fusion/container/deque/detail/cpp03/preprocessed/as_deque.hpp>
51 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
52 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/as_deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
55 /*=============================================================================
56 Copyright (c) 2001-2011 Joel de Guzman
58 Distributed under the Boost Software License, Version 1.0. (See accompanying
59 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
61 This is an auto-generated file. Do not edit!
62 ==============================================================================*/
64 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
65 #pragma wave option(preserve: 1)
68 namespace boost { namespace fusion { namespace detail
70 #define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \
71 typedef typename fusion::result_of::next<BOOST_PP_CAT(I, n)>::type \
72 BOOST_PP_CAT(I, BOOST_PP_INC(n));
74 #define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \
75 typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \
76 BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n));
78 #define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \
79 typedef typename fusion::result_of::value_of<BOOST_PP_CAT(I, n)>::type \
82 #define BOOST_PP_FILENAME_1 <boost/fusion/container/deque/detail/cpp03/as_deque.hpp>
83 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE)
84 #include BOOST_PP_ITERATE()
86 #undef BOOST_FUSION_NEXT_ITERATOR
87 #undef BOOST_FUSION_NEXT_CALL_ITERATOR
88 #undef BOOST_FUSION_VALUE_OF_ITERATOR
92 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
93 #pragma wave option(output: null)
96 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
99 #else // defined(BOOST_PP_IS_ITERATING)
100 ///////////////////////////////////////////////////////////////////////////////
102 // Preprocessor vertical repetition code
104 ///////////////////////////////////////////////////////////////////////////////
106 #define N BOOST_PP_ITERATION()
111 template <typename I0>
114 BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _)
115 BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _)
116 typedef deque<BOOST_PP_ENUM_PARAMS(N, T)> type;
119 template <typename Iterator>
120 BOOST_FUSION_GPU_ENABLED
121 static typename apply<Iterator>::type
122 call(Iterator const& i0)
124 typedef apply<Iterator> gen;
125 typedef typename gen::type result;
126 BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _)
127 return result(BOOST_PP_ENUM_PARAMS(N, *i));
132 #endif // defined(BOOST_PP_IS_ITERATING)