]> git.lyx.org Git - lyx.git/blob - 3rdparty/boost/boost/fusion/view/joint_view/joint_view_iterator.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / fusion / view / joint_view / joint_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_JOINT_VIEW_ITERATOR_07162005_0140)
8 #define FUSION_JOINT_VIEW_ITERATOR_07162005_0140
9
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/support/iterator_base.hpp>
12 #include <boost/fusion/iterator/equal_to.hpp>
13 #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
14 #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
15 #include <boost/fusion/view/joint_view/detail/deref_impl.hpp>
16 #include <boost/fusion/view/joint_view/detail/next_impl.hpp>
17 #include <boost/fusion/view/joint_view/detail/value_of_impl.hpp>
18 #include <boost/fusion/view/joint_view/detail/deref_data_impl.hpp>
19 #include <boost/fusion/view/joint_view/detail/value_of_data_impl.hpp>
20 #include <boost/fusion/view/joint_view/detail/key_of_impl.hpp>
21 #include <boost/static_assert.hpp>
22
23 namespace boost { namespace fusion
24 {
25     struct joint_view_iterator_tag;
26     struct forward_traversal_tag;
27
28     template <typename Category, typename First, typename Last, typename Concat>
29     struct joint_view_iterator
30         : iterator_base<joint_view_iterator<Category, First, Last, Concat> >
31     {
32         typedef convert_iterator<First> first_converter;
33         typedef convert_iterator<Last> last_converter;
34         typedef convert_iterator<Concat> concat_converter;
35
36         typedef typename first_converter::type first_type;
37         typedef typename last_converter::type last_type;
38         typedef typename concat_converter::type concat_type;
39
40         typedef joint_view_iterator_tag fusion_tag;
41         typedef Category category;
42         BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
43
44         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
45         joint_view_iterator(First const& in_first, Concat const& in_concat)
46             : first(first_converter::call(in_first))
47             , concat(concat_converter::call(in_concat))
48         {}
49
50         first_type first;
51         concat_type concat;
52
53     private:
54         // silence MSVC warning C4512: assignment operator could not be generated
55         joint_view_iterator& operator= (joint_view_iterator const&);
56     };
57 }}
58
59 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
60 namespace std
61 {
62     template <typename Category, typename First, typename Last, typename Concat>
63     struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
64     { };
65 }
66 #endif
67
68 #endif
69
70