/*============================================================================= 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_1149) #define FUSION_ADVANCE_09172005_1149 #include #include #include #include #include #include namespace boost { namespace fusion { namespace advance_detail { // Default advance implementation, perform next(i) // or prior(i) N times. template struct forward; template struct next_forward { typedef typename forward< typename result_of::next::type , N-1 >::type type; }; template struct forward { typedef typename mpl::eval_if_c< (N == 0) , mpl::identity , next_forward >::type type; static type const& call(type const& i) { return i; } template static type call(I const& i) { return call(fusion::next(i)); } }; template struct backward; template struct next_backward { typedef typename backward< typename result_of::prior::type , N+1 >::type type; }; template struct backward { typedef typename mpl::eval_if_c< (N == 0) , mpl::identity , next_backward >::type type; static type const& call(type const& i) { return i; } template static type call(I const& i) { return call(fusion::prior(i)); } }; }}} #endif