source: NonGTP/Boost/boost/spirit/fusion/iterator/next.hpp @ 857

Revision 857, 1.6 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 2003 Joel de Guzman
3
4    Use, modification and distribution is subject to the Boost Software
5    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6    http://www.boost.org/LICENSE_1_0.txt)
7==============================================================================*/
8#if !defined(FUSION_ITERATOR_NEXT_HPP)
9#define FUSION_ITERATOR_NEXT_HPP
10
11#include <boost/spirit/fusion/detail/config.hpp>
12#include <boost/spirit/fusion/iterator/as_fusion_iterator.hpp>
13
14namespace boost { namespace fusion
15{
16    namespace meta
17    {
18        template <typename Tag>
19        struct next_impl
20        {
21            template <typename Iterator>
22            struct apply
23            {
24                // VC6 needs this
25                typedef int type;
26            };
27        };
28
29        template <typename Iterator>
30        struct next
31        {
32            typedef as_fusion_iterator<Iterator> converter;
33            typedef typename converter::type iter;
34
35            typedef typename
36                next_impl<FUSION_GET_TAG(iter)>::
37                    template apply<iter>::type
38            type;
39        };
40    }
41
42    template <typename Iterator>
43    inline typename meta::next<Iterator>::type
44    next(Iterator const& i)
45    {
46        typedef as_fusion_iterator<Iterator> converter;
47        typedef typename converter::type iter;
48
49        return meta::next_impl<FUSION_GET_TAG(iter)>::
50            template apply<iter>::call(converter::convert(i));
51    }
52}}
53
54#endif
Note: See TracBrowser for help on using the repository browser.