1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033)
8 #define FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/support/iterator_base.hpp>
12 #include <boost/fusion/support/category_of.hpp>
13 #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
14 #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
15 #include <boost/fusion/view/transform_view/detail/deref_impl.hpp>
16 #include <boost/fusion/view/transform_view/detail/next_impl.hpp>
17 #include <boost/fusion/view/transform_view/detail/prior_impl.hpp>
18 #include <boost/fusion/view/transform_view/detail/value_of_impl.hpp>
19 #include <boost/fusion/view/transform_view/detail/advance_impl.hpp>
20 #include <boost/fusion/view/transform_view/detail/distance_impl.hpp>
21 #include <boost/fusion/view/transform_view/detail/equal_to_impl.hpp>
23 namespace boost { namespace fusion
26 struct transform_view_iterator_tag;
28 template <typename First, typename F>
29 struct transform_view_iterator
30 : iterator_base<transform_view_iterator<First, F> >
32 typedef transform_view_iterator_tag fusion_tag;
33 typedef convert_iterator<First> converter;
34 typedef typename converter::type first_type;
35 typedef typename traits::category_of<first_type>::type category;
36 typedef F transform_type;
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39 transform_view_iterator(First const& in_first, F const& in_f)
40 : first(converter::call(in_first)), f(in_f) {}
46 // silence MSVC warning C4512: assignment operator could not be generated
47 transform_view_iterator& operator= (transform_view_iterator const&);
51 struct transform_view_iterator2_tag;
53 template <typename First1, typename First2, typename F>
54 struct transform_view_iterator2
55 : iterator_base<transform_view_iterator2<First1, First2, F> >
57 typedef transform_view_iterator2_tag fusion_tag;
58 typedef convert_iterator<First1> converter1;
59 typedef convert_iterator<First2> converter2;
60 typedef typename converter1::type first1_type;
61 typedef typename converter2::type first2_type;
62 typedef typename traits::category_of<first1_type>::type category;
63 typedef F transform_type;
65 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
66 transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f)
67 : first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {}
74 // silence MSVC warning C4512: assignment operator could not be generated
75 transform_view_iterator2& operator= (transform_view_iterator2 const&);
79 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
82 template <typename First, typename F>
83 struct iterator_traits< ::boost::fusion::transform_view_iterator<First, F> >
85 template <typename First1, typename First2, typename F>
86 struct iterator_traits< ::boost::fusion::transform_view_iterator2<First1, First2, F> >