1 /*=============================================================================
2 Copyright (c) 2001-2011 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/fusion/support/config.hpp>
11 #include <boost/mpl/int.hpp>
12 #include <boost/mpl/if.hpp>
13 #include <boost/mpl/eval_if.hpp>
14 #include <boost/mpl/identity.hpp>
15 #include <boost/fusion/iterator/next.hpp>
16 #include <boost/fusion/iterator/prior.hpp>
18 namespace boost { namespace fusion { namespace advance_detail
20 // Default advance implementation, perform next(i)
21 // or prior(i) N times.
23 template <typename Iterator, int N>
26 template <typename Iterator, int N>
31 typename result_of::next<Iterator>::type
37 template <typename Iterator, int N>
43 , mpl::identity<Iterator>
44 , next_forward<Iterator, N>
48 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
56 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
60 return call(fusion::next(i));
64 template <typename Iterator, int N>
67 template <typename Iterator, int N>
72 typename result_of::prior<Iterator>::type
78 template <typename Iterator, int N>
84 , mpl::identity<Iterator>
85 , next_backward<Iterator, N>
89 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
97 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
101 return call(fusion::prior(i));