/*============================================================================= 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_ADVANCE_09172005_1146) #define FUSION_ADVANCE_09172005_1146 #include #include #include #include #include #include namespace boost { namespace fusion { struct random_access_traversal_tag; // Special tags: struct iterator_facade_tag; // iterator facade tag struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag namespace extension { template struct advance_impl { // default implementation template struct apply : mpl::if_c< (N::value > 0) , advance_detail::forward , advance_detail::backward >::type { BOOST_MPL_ASSERT_NOT((traits::is_random_access)); }; }; template <> struct advance_impl { template struct apply : Iterator::template advance {}; }; template <> struct advance_impl; template <> struct advance_impl; template <> struct advance_impl; } namespace result_of { template struct advance_c : extension::advance_impl::type>::template apply > {}; template struct advance : extension::advance_impl::type>::template apply {}; } template inline typename result_of::advance_c::type const advance_c(Iterator const& i) { return result_of::advance_c::call(i); } template inline typename result_of::advance::type const advance(Iterator const& i) { return result_of::advance::call(i); } }} // namespace boost::fusion #endif