]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/view/single_view/detail/advance_impl.hpp
d0846ec4e5fd858743148933b3c0a08a1f9c5e0d
[rsem.git] / boost / fusion / view / single_view / detail / advance_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2011 Eric Niebler
3
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
8 #if !defined(BOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM)
9 #define BOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM
10
11 #include <boost/mpl/plus.hpp>
12
13 namespace boost { namespace fusion 
14 {
15     struct single_view_iterator_tag;
16
17     template <typename SingleView, typename Pos>
18     struct single_view_iterator;
19
20     namespace extension
21     {
22         template<typename Tag>
23         struct advance_impl;
24
25         template<>
26         struct advance_impl<single_view_iterator_tag>
27         {
28             template<typename Iterator, typename Dist>
29             struct apply
30             {
31                 typedef single_view_iterator<
32                     typename Iterator::single_view_type,
33                     typename mpl::plus<typename Iterator::position, Dist>::type>
34                 type;
35
36                 static type
37                 call(Iterator const& i)
38                 {
39                     return type(i.view);
40                 }
41             };
42         };
43     }
44
45 }}
46
47 #endif