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#ifdef _MSC_VER
24# pragma warning(push)
25# pragma warning(disable: 4512) // assignment operator could not be generated.
26#endif
27
28namespace boost { namespace fusion
29{
30 struct joint_view_iterator_tag;
31 struct forward_traversal_tag;
32
33 template <typename Category, typename First, typename Last, typename Concat>
34 struct joint_view_iterator
35 : iterator_base<joint_view_iterator<Category, First, Last, Concat> >
36 {
37 typedef convert_iterator<First> first_converter;
38 typedef convert_iterator<Last> last_converter;
39 typedef convert_iterator<Concat> concat_converter;
40
41 typedef typename first_converter::type first_type;
42 typedef typename last_converter::type last_type;
43 typedef typename concat_converter::type concat_type;
44
45 typedef joint_view_iterator_tag fusion_tag;
46 typedef Category category;
47 BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
48
49 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
50 joint_view_iterator(First const& in_first, Concat const& in_concat)
51 : first(first_converter::call(in_first))
52 , concat(concat_converter::call(in_concat))
53 {}
54
55 first_type first;
56 concat_type concat;
57 };
58}}
59
60#ifdef _MSC_VER
61# pragma warning(pop)
62#endif
63
64#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
65namespace std
66{
67 template <typename Category, typename First, typename Last, typename Concat>
68 struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
69 { };
70}
71#endif
72
73#endif
74
75
76