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_TRANSFORM_VIEW_ITERATOR_HPP)
|
---|
10 | #define FUSION_ITERATOR_TRANSFORM_VIEW_ITERATOR_HPP
|
---|
11 |
|
---|
12 | #include <boost/spirit/fusion/iterator/as_fusion_iterator.hpp>
|
---|
13 | #include <boost/spirit/fusion/iterator/detail/iterator_base.hpp>
|
---|
14 | #include <boost/spirit/fusion/iterator/detail/transform_view_iterator/deref_traits.hpp>
|
---|
15 | #include <boost/spirit/fusion/iterator/detail/transform_view_iterator/next_traits.hpp>
|
---|
16 | #include <boost/spirit/fusion/iterator/detail/transform_view_iterator/value_traits.hpp>
|
---|
17 |
|
---|
18 | namespace boost { namespace fusion
|
---|
19 | {
|
---|
20 | struct transform_view_iterator_tag;
|
---|
21 |
|
---|
22 | template <typename First, typename F>
|
---|
23 | struct transform_view_iterator
|
---|
24 | : iterator_base<transform_view_iterator<First, F> >
|
---|
25 | {
|
---|
26 | typedef transform_view_iterator_tag tag;
|
---|
27 | typedef as_fusion_iterator<First> converter;
|
---|
28 | typedef typename converter::type first_type;
|
---|
29 | typedef F transform_type;
|
---|
30 |
|
---|
31 | transform_view_iterator(First const& first, F f);
|
---|
32 |
|
---|
33 | first_type first;
|
---|
34 | transform_type f;
|
---|
35 | };
|
---|
36 |
|
---|
37 | template <typename First, typename F>
|
---|
38 | transform_view_iterator<First,F>::transform_view_iterator(First const& first, F f)
|
---|
39 | : first(converter::convert(first)), f(f) {}
|
---|
40 |
|
---|
41 | }}
|
---|
42 |
|
---|
43 | #endif
|
---|
44 |
|
---|