/*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef BOOST_PP_IS_ITERATING #if !defined(FUSION_ZIP_HPP_20060125_2058) #define FUSION_ZIP_HPP_20060125_2058 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(FUSION_MAX_ZIP_SEQUENCES) #define FUSION_MAX_ZIP_SEQUENCES 10 #endif namespace boost { namespace fusion { struct void_; namespace result_of { template struct zip; } #define BOOST_PP_FILENAME_1 \ #define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES) #include BOOST_PP_ITERATE() }} #endif #else #define ZIP_ITERATION BOOST_PP_ITERATION() namespace result_of { template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) > #if defined(BOOST_PARTIAL_SPECIALIZATION_EXPLICT_ARGS) #define TEXT(z, n, text) , text struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(ZIP_ITERATION), FUSION_MAX_ZIP_SEQUENCES, TEXT, void_) > #undef TEXT #else struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > #endif { typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences; typedef typename mpl::transform >::type ref_params; typedef zip_view::type> type; }; } #define FUSION_REF_PARAM(z, n, data) const T ## n& template inline typename result_of::zip::type zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t)) { fusion::vector seqs( BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t)); return typename result_of::zip::type( seqs); } #undef FUSION_REF_PARAM #undef ZIP_ITERATION #endif