/*============================================================================= Copyright (c) 2001-2011 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) ==============================================================================*/ #if !defined(FUSION_ZIP_VIEW_23012006_0813) #define FUSION_ZIP_VIEW_23012006_0813 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { namespace detail { template struct all_references : fusion::result_of::equal_to > >::type, typename fusion::result_of::end::type> {}; struct seq_ref_size { template struct result; template struct result { static int const high_int = static_cast( (static_cast(~0) >> 1) - 1); typedef typename remove_reference::type SeqClass; typedef typename mpl::eval_if< traits::is_forward, result_of::size, mpl::int_ >::type type; }; // never called, but needed for decltype-based result_of (C++0x) #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq&&) const; #endif }; struct poly_min { template struct result; template struct result { typedef typename remove_reference::type lhs; typedef typename remove_reference::type rhs; typedef typename mpl::min::type type; }; // never called, but needed for decltype-based result_of (C++0x) #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template BOOST_FUSION_GPU_ENABLED typename result::type operator()(Lhs&&, Rhs&&) const; #endif }; template struct min_size { typedef typename result_of::transform::type sizes; typedef typename result_of::fold::type, detail::poly_min>::type type; }; } struct zip_view_tag; struct fusion_sequence_tag; template struct zip_view : sequence_base< zip_view > { typedef typename result_of::remove::type real_sequences; BOOST_MPL_ASSERT((detail::all_references)); typedef typename detail::strictest_traversal::type category; typedef zip_view_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; typedef typename fusion::result_of::as_vector::type sequences; typedef typename detail::min_size::type size; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED zip_view( const Sequences& seqs) : sequences_(seqs) {}; sequences sequences_; }; }} #endif