1 /*============================================================================= 2 Copyright (c) 2001-2011 Joel de Guzman 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 ==============================================================================*/ 7 #if !defined(FUSION_NEXT_IMPL_07162005_1029) 8 #define FUSION_NEXT_IMPL_07162005_1029 9 10 #include <boost/fusion/support/config.hpp> 11 #include <boost/fusion/iterator/next.hpp> 12 13 namespace boost { namespace fusion 14 { 15 struct transform_view_iterator_tag; 16 struct transform_view_iterator2_tag; 17 18 template<typename First, typename F> 19 struct transform_view_iterator; 20 21 template <typename First1, typename First2, typename F> 22 struct transform_view_iterator2; 23 24 namespace extension 25 { 26 template <typename Tag> 27 struct next_impl; 28 29 // Unary Version 30 template <> 31 struct next_impl<transform_view_iterator_tag> 32 { 33 template <typename Iterator> 34 struct apply 35 { 36 typedef typename Iterator::first_type first_type; 37 typedef typename result_of::next<first_type>::type next_type; 38 typedef typename Iterator::transform_type transform_type; 39 typedef transform_view_iterator<next_type, transform_type> type; 40 41 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 42 static type callboost::fusion::extension::next_impl::apply43 call(Iterator const& i) 44 { 45 return type(fusion::next(i.first), i.f); 46 } 47 }; 48 }; 49 50 // Binary Version 51 template <> 52 struct next_impl<transform_view_iterator2_tag> 53 { 54 template <typename Iterator> 55 struct apply 56 { 57 typedef typename Iterator::first1_type first1_type; 58 typedef typename Iterator::first2_type first2_type; 59 typedef typename result_of::next<first1_type>::type next1_type; 60 typedef typename result_of::next<first2_type>::type next2_type; 61 typedef typename Iterator::transform_type transform_type; 62 typedef transform_view_iterator2<next1_type, next2_type, transform_type> type; 63 64 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 65 static type callboost::fusion::extension::next_impl::apply66 call(Iterator const& i) 67 { 68 return type(fusion::next(i.first1), fusion::next(i.first2), i.f); 69 } 70 }; 71 }; 72 } 73 }} 74 75 #endif 76 77 78