File indexing completed on 2025-01-18 09:31:17
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_PP_IS_ITERATING
0009 #if !defined(FUSION_ZIP_HPP_20060125_2058)
0010 #define FUSION_ZIP_HPP_20060125_2058
0011
0012 #include <boost/fusion/view/zip_view.hpp>
0013 #include <boost/fusion/adapted/mpl.hpp>
0014 #include <boost/fusion/container/vector.hpp>
0015 #include <boost/fusion/container/vector/convert.hpp>
0016 #include <boost/fusion/support/detail/pp_round.hpp>
0017 #include <boost/type_traits/add_reference.hpp>
0018 #include <boost/preprocessor/repetition/enum.hpp>
0019 #include <boost/preprocessor/repetition/enum_params.hpp>
0020 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
0021 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0022 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0023 #include <boost/preprocessor/arithmetic/inc.hpp>
0024 #include <boost/preprocessor/iteration/iterate.hpp>
0025 #include <boost/mpl/vector.hpp>
0026 #include <boost/mpl/transform.hpp>
0027 #include <boost/mpl/placeholders.hpp>
0028
0029 #if !defined(FUSION_MAX_ZIP_SEQUENCES)
0030 #define FUSION_MAX_ZIP_SEQUENCES 10
0031 #endif
0032
0033 #define FUSION_MAX_ZIP_SEQUENCES_STR BOOST_PP_STRINGIZE(BOOST_FUSION_PP_ROUND_UP(FUSION_MAX_ZIP_SEQUENCES))
0034
0035 #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
0036 #include <boost/fusion/algorithm/transformation/detail/preprocessed/zip.hpp>
0037 #else
0038 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0039 #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/zip" FUSION_MAX_ZIP_SEQUENCES_STR ".hpp")
0040 #endif
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0053 #pragma wave option(preserve: 1)
0054 #endif
0055
0056 namespace boost { namespace fusion
0057 {
0058 struct void_;
0059
0060 namespace result_of
0061 {
0062 template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(FUSION_MAX_ZIP_SEQUENCES), typename T, fusion::void_)>
0063 struct zip;
0064 }
0065
0066 #define FUSION_TEXT(z, n, text) , text
0067
0068 #define BOOST_PP_FILENAME_1 \
0069 <boost/fusion/algorithm/transformation/zip.hpp>
0070 #define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES)
0071 #include BOOST_PP_ITERATE()
0072
0073 #undef FUSION_TEXT
0074
0075 }}
0076
0077 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0078 #pragma wave option(output: null)
0079 #endif
0080
0081 #endif
0082
0083 #endif
0084
0085 #else
0086
0087 #define ZIP_ITERATION BOOST_PP_ITERATION()
0088
0089 namespace result_of
0090 {
0091 template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) >
0092 struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T)
0093 BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(ZIP_ITERATION), FUSION_MAX_ZIP_SEQUENCES, FUSION_TEXT, void_)
0094 >
0095 {
0096 typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences;
0097 typedef typename mpl::transform<sequences, add_reference<mpl::_> >::type ref_params;
0098 typedef zip_view<typename result_of::as_vector<ref_params>::type> type;
0099 };
0100 }
0101
0102 #define FUSION_REF_PARAM(z, n, data) const T ## n&
0103
0104 template<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T)>
0105 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0106 inline typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type
0107 zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t))
0108 {
0109 fusion::vector<BOOST_PP_ENUM(ZIP_ITERATION, FUSION_REF_PARAM, _)> seqs(
0110 BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t));
0111 return typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type(
0112 seqs);
0113 }
0114
0115 #undef FUSION_REF_PARAM
0116 #undef ZIP_ITERATION
0117
0118 #endif