1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
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_ADVANCE_09172005_1149)
8 #define FUSION_ADVANCE_09172005_1149
10 #include <boost/mpl/int.hpp>
11 #include <boost/mpl/if.hpp>
12 #include <boost/mpl/eval_if.hpp>
13 #include <boost/mpl/identity.hpp>
14 #include <boost/fusion/iterator/next.hpp>
15 #include <boost/fusion/iterator/prior.hpp>
17 namespace boost { namespace fusion { namespace advance_detail
19 // Default advance implementation, perform next(i)
20 // or prior(i) N times.
22 template <typename Iterator, int N>
25 template <typename Iterator, int N>
30 typename result_of::next<Iterator>::type
36 template <typename Iterator, int N>
42 , mpl::identity<Iterator>
43 , next_forward<Iterator, N>
57 return call(fusion::next(i));
61 template <typename Iterator, int N>
64 template <typename Iterator, int N>
69 typename result_of::prior<Iterator>::type
75 template <typename Iterator, int N>
81 , mpl::identity<Iterator>
82 , next_backward<Iterator, N>
96 return call(fusion::prior(i));