/*============================================================================= 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_PRIOR_IMPL_20060124_2006) #define FUSION_PRIOR_IMPL_20060124_2006 #include #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { struct zip_view_iterator_tag; namespace detail { struct poly_prior { template struct result; template struct result { typedef typename remove_const< typename remove_reference::type>::type it; typedef typename mpl::eval_if, mpl::identity, result_of::prior >::type type; }; template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::prior(it); } BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); } }; } namespace extension { template struct prior_impl; template<> struct prior_impl { template struct apply { typedef zip_view_iterator< typename result_of::transform::type, typename Iterator::category> type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { return type( fusion::transform(it.iterators_, detail::poly_prior())); } }; }; } }} #endif