]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / fusion / include / boost / fusion / view / reverse_view / detail / advance_impl.hpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
4
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
10
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/advance.hpp>
13 #include <boost/mpl/negate.hpp>
14
15 namespace boost { namespace fusion {
16
17 struct reverse_view_iterator_tag;
18
19 template <typename Iterator>
20 struct reverse_view_iterator;
21
22 namespace extension
23 {
24 template<typename Tag>
25 struct advance_impl;
26
27 template<>
28 struct advance_impl<reverse_view_iterator_tag>
29 {
30 template<typename Iterator, typename Dist>
31 struct apply
32 {
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;
37
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39 static type
40 call(Iterator const& i)
41 {
42 return type(boost::fusion::advance<negative_dist>(i.first));
43 }
44 };
45 };
46 }
47 }}
48
49 #endif