source: NonGTP/Boost/boost/spirit/fusion/iterator/detail/transform_view_iterator/next_traits.hpp @ 857

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