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/fusion/support/config.hpp>
12 #include <boost/mpl/next.hpp>
13 #include <boost/static_assert.hpp>
14 
15 namespace boost { namespace fusion
16 {
17     struct single_view_iterator_tag;
18 
19     template <typename SingleView, typename Pos>
20     struct single_view_iterator;
21 
22     namespace extension
23     {
24         template <typename Tag>
25         struct next_impl;
26 
27         template <>
28         struct next_impl<single_view_iterator_tag>
29         {
30             template <typename Iterator>
31             struct apply
32             {
33                 typedef single_view_iterator<
34                     typename Iterator::single_view_type,
35                     typename mpl::next<typename Iterator::position>::type>
36                 type;
37 
38                 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39                 static type
callboost::fusion::extension::next_impl::apply40                 call(Iterator const& i)
41                 {
42                     BOOST_STATIC_ASSERT((type::position::value < 2));
43                     return type(i.view);
44                 }
45             };
46         };
47     }
48 }}
49 
50 #endif
51 
52 
53