/*============================================================================= 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_END_IMPL_20060123_2208) #define FUSION_END_IMPL_20060123_2208 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { struct zip_view_tag; namespace detail { template struct get_endpoint { typedef typename remove_reference::type Seq; typedef typename result_of::begin::type begin; typedef typename result_of::advance::type type; }; template struct endpoints { template struct result; template struct result(SeqRef)> : mpl::eval_if, mpl::identity, get_endpoint > { BOOST_MPL_ASSERT((is_reference)); }; template BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { return fusion::advance(fusion::begin(seq)); } template BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::advance(fusion::begin(seq)); } BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); } }; } namespace extension { template struct end_impl; template<> struct end_impl { template struct apply { typedef zip_view_iterator< typename result_of::transform >::type, typename Sequence::category> type; BOOST_FUSION_GPU_ENABLED static type call(Sequence& sequence) { return type( fusion::transform(sequence.sequences_, detail::endpoints())); } }; }; } }} #endif