/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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_ITERATOR_ADAPTER_08112011_0942) #define FUSION_ITERATOR_ADAPTER_08112011_0942 #include #include #include #include namespace boost { namespace fusion { template struct iterator_adapter : iterator_facade { typedef typename remove_const::type iterator_base_type; iterator_base_type iterator_base; BOOST_FUSION_GPU_ENABLED iterator_adapter(iterator_base_type const& iterator_base_) : iterator_base(iterator_base_) {} // default implementation template struct equal_to : result_of::equal_to< typename I1::iterator_base_type , typename I2::iterator_base_type > {}; // default implementation template struct advance { typedef typename Derived_::template make< typename result_of::advance< typename Iterator::iterator_base_type, N >::type>::type type; BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { return type(fusion::advance(it.iterator_base)); } }; // default implementation template struct distance : result_of::distance< typename First::iterator_base_type , typename Last::iterator_base_type > {}; // default implementation template struct value_of : result_of::value_of< typename Iterator::iterator_base_type > {}; // default implementation template struct deref { typedef typename result_of::deref< typename Iterator::iterator_base_type >::type type; BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { return fusion::deref(it.iterator_base); } }; // default implementation template struct next { typedef typename Derived_::template make< typename result_of::next< typename Iterator::iterator_base_type >::type>::type type; BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(fusion::next(i.iterator_base)); } }; // default implementation template struct prior { typedef typename Derived_::template make< typename result_of::prior< typename Iterator::iterator_base_type >::type>::type type; BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(fusion::prior(i.iterator_base)); } }; }; }} #endif