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