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