1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(FUSION_ADVANCE_IMPL_14122005_2015)
9 #define FUSION_ADVANCE_IMPL_14122005_2015
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/advance.hpp>
13 #include <boost/mpl/negate.hpp>
15 namespace boost { namespace fusion {
17 struct reverse_view_iterator_tag;
19 template <typename Iterator>
20 struct reverse_view_iterator;
24 template<typename Tag>
28 struct advance_impl<reverse_view_iterator_tag>
30 template<typename Iterator, typename Dist>
33 typedef typename Iterator::first_type first_type;
34 typedef typename mpl::negate<Dist>::type negative_dist;
35 typedef typename result_of::advance<first_type, negative_dist>::type advanced_type;
36 typedef reverse_view_iterator<advanced_type> type;
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
40 call(Iterator const& i)
42 return type(boost::fusion::advance<negative_dist>(i.first));