Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3 Copyright (c) 2006 Dan Marsden
|
Chris@16
|
4
|
Chris@16
|
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 ==============================================================================*/
|
Chris@16
|
8 #ifndef BOOST_PP_IS_ITERATING
|
Chris@16
|
9 #if !defined(FUSION_ZIP_HPP_20060125_2058)
|
Chris@16
|
10 #define FUSION_ZIP_HPP_20060125_2058
|
Chris@16
|
11
|
Chris@16
|
12 #include <boost/fusion/view/zip_view.hpp>
|
Chris@16
|
13 #include <boost/fusion/adapted/mpl.hpp>
|
Chris@16
|
14 #include <boost/fusion/container/vector.hpp>
|
Chris@16
|
15 #include <boost/fusion/container/vector/convert.hpp>
|
Chris@16
|
16 #include <boost/fusion/support/detail/pp_round.hpp>
|
Chris@16
|
17 #include <boost/type_traits/add_reference.hpp>
|
Chris@16
|
18 #include <boost/preprocessor/repetition/enum.hpp>
|
Chris@16
|
19 #include <boost/preprocessor/repetition/enum_params.hpp>
|
Chris@16
|
20 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
Chris@16
|
21 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
Chris@16
|
22 #include <boost/preprocessor/arithmetic/inc.hpp>
|
Chris@16
|
23 #include <boost/preprocessor/iteration/iterate.hpp>
|
Chris@16
|
24 #include <boost/mpl/vector.hpp>
|
Chris@16
|
25 #include <boost/mpl/transform.hpp>
|
Chris@16
|
26 #include <boost/mpl/placeholders.hpp>
|
Chris@16
|
27
|
Chris@16
|
28 #if !defined(FUSION_MAX_ZIP_SEQUENCES)
|
Chris@16
|
29 #define FUSION_MAX_ZIP_SEQUENCES 10
|
Chris@16
|
30 #endif
|
Chris@16
|
31
|
Chris@16
|
32 #define FUSION_MAX_ZIP_SEQUENCES_STR BOOST_PP_STRINGIZE(BOOST_FUSION_PP_ROUND_UP(FUSION_MAX_ZIP_SEQUENCES))
|
Chris@16
|
33
|
Chris@16
|
34 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
35 #include <boost/fusion/algorithm/transformation/detail/preprocessed/zip.hpp>
|
Chris@16
|
36 #else
|
Chris@16
|
37 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
38 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/zip" FUSION_MAX_ZIP_SEQUENCES_STR ".hpp")
|
Chris@16
|
39 #endif
|
Chris@16
|
40
|
Chris@16
|
41 /*=============================================================================
|
Chris@16
|
42 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
43 Copyright (c) 2006 Dan Marsden
|
Chris@16
|
44
|
Chris@16
|
45 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
46 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
47
|
Chris@16
|
48 This is an auto-generated file. Do not edit!
|
Chris@16
|
49 ==============================================================================*/
|
Chris@16
|
50
|
Chris@16
|
51 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
52 #pragma wave option(preserve: 1)
|
Chris@16
|
53 #endif
|
Chris@16
|
54
|
Chris@16
|
55 namespace boost { namespace fusion
|
Chris@16
|
56 {
|
Chris@16
|
57 struct void_;
|
Chris@16
|
58
|
Chris@16
|
59 namespace result_of
|
Chris@16
|
60 {
|
Chris@16
|
61 template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(FUSION_MAX_ZIP_SEQUENCES), typename T, fusion::void_)>
|
Chris@16
|
62 struct zip;
|
Chris@16
|
63 }
|
Chris@16
|
64
|
Chris@101
|
65 #define FUSION_TEXT(z, n, text) , text
|
Chris@101
|
66
|
Chris@16
|
67 #define BOOST_PP_FILENAME_1 \
|
Chris@16
|
68 <boost/fusion/algorithm/transformation/zip.hpp>
|
Chris@16
|
69 #define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES)
|
Chris@16
|
70 #include BOOST_PP_ITERATE()
|
Chris@16
|
71
|
Chris@101
|
72 #undef FUSION_TEXT
|
Chris@101
|
73
|
Chris@16
|
74 }}
|
Chris@16
|
75
|
Chris@16
|
76 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
77 #pragma wave option(output: null)
|
Chris@16
|
78 #endif
|
Chris@16
|
79
|
Chris@16
|
80 #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
|
Chris@16
|
81
|
Chris@16
|
82 #endif
|
Chris@16
|
83
|
Chris@16
|
84 #else
|
Chris@16
|
85
|
Chris@16
|
86 #define ZIP_ITERATION BOOST_PP_ITERATION()
|
Chris@16
|
87
|
Chris@16
|
88 namespace result_of
|
Chris@16
|
89 {
|
Chris@16
|
90 template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) >
|
Chris@101
|
91 struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T)
|
Chris@101
|
92 BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(ZIP_ITERATION), FUSION_MAX_ZIP_SEQUENCES, FUSION_TEXT, void_)
|
Chris@101
|
93 >
|
Chris@16
|
94 {
|
Chris@16
|
95 typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences;
|
Chris@16
|
96 typedef typename mpl::transform<sequences, add_reference<mpl::_> >::type ref_params;
|
Chris@16
|
97 typedef zip_view<typename result_of::as_vector<ref_params>::type> type;
|
Chris@16
|
98 };
|
Chris@16
|
99 }
|
Chris@16
|
100
|
Chris@16
|
101 #define FUSION_REF_PARAM(z, n, data) const T ## n&
|
Chris@16
|
102
|
Chris@16
|
103 template<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T)>
|
Chris@101
|
104 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
105 inline typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type
|
Chris@16
|
106 zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t))
|
Chris@16
|
107 {
|
Chris@16
|
108 fusion::vector<BOOST_PP_ENUM(ZIP_ITERATION, FUSION_REF_PARAM, _)> seqs(
|
Chris@16
|
109 BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t));
|
Chris@16
|
110 return typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type(
|
Chris@16
|
111 seqs);
|
Chris@16
|
112 }
|
Chris@16
|
113
|
Chris@16
|
114 #undef FUSION_REF_PARAM
|
Chris@16
|
115 #undef ZIP_ITERATION
|
Chris@16
|
116
|
Chris@16
|
117 #endif
|