]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/fusion/view/transform_view/transform_view_iterator.hpp
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / boost / boost / fusion / view / transform_view / transform_view_iterator.hpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3
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
9
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>
22
23 namespace boost { namespace fusion
24 {
25 // Unary Version
26 struct transform_view_iterator_tag;
27
28 template <typename First, typename F>
29 struct transform_view_iterator
30 : iterator_base<transform_view_iterator<First, F> >
31 {
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;
37
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) {}
41
42 first_type first;
43 transform_type f;
44
45 // silence MSVC warning C4512: assignment operator could not be generated
46 BOOST_DELETED_FUNCTION(transform_view_iterator& operator= (transform_view_iterator const&))
47 };
48
49 // Binary Version
50 struct transform_view_iterator2_tag;
51
52 template <typename First1, typename First2, typename F>
53 struct transform_view_iterator2
54 : iterator_base<transform_view_iterator2<First1, First2, F> >
55 {
56 typedef transform_view_iterator2_tag fusion_tag;
57 typedef convert_iterator<First1> converter1;
58 typedef convert_iterator<First2> converter2;
59 typedef typename converter1::type first1_type;
60 typedef typename converter2::type first2_type;
61 typedef typename traits::category_of<first1_type>::type category;
62 typedef F transform_type;
63
64 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
65 transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f)
66 : first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {}
67
68 first1_type first1;
69 first2_type first2;
70 transform_type f;
71
72 // silence MSVC warning C4512: assignment operator could not be generated
73 BOOST_DELETED_FUNCTION(transform_view_iterator2& operator= (transform_view_iterator2 const&))
74 };
75 }}
76
77 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
78 namespace std
79 {
80 template <typename First, typename F>
81 struct iterator_traits< ::boost::fusion::transform_view_iterator<First, F> >
82 { };
83 template <typename First1, typename First2, typename F>
84 struct iterator_traits< ::boost::fusion::transform_view_iterator2<First1, First2, F> >
85 { };
86 }
87 #endif
88
89 #endif
90