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_REVERSE_VIEW_ITERATOR_07202005_0835)
8 #define FUSION_REVERSE_VIEW_ITERATOR_07202005_0835
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/reverse_view/detail/deref_impl.hpp>
16 #include <boost/fusion/view/reverse_view/detail/next_impl.hpp>
17 #include <boost/fusion/view/reverse_view/detail/prior_impl.hpp>
18 #include <boost/fusion/view/reverse_view/detail/advance_impl.hpp>
19 #include <boost/fusion/view/reverse_view/detail/distance_impl.hpp>
20 #include <boost/fusion/view/reverse_view/detail/value_of_impl.hpp>
21 #include <boost/fusion/view/reverse_view/detail/deref_data_impl.hpp>
22 #include <boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp>
23 #include <boost/fusion/view/reverse_view/detail/key_of_impl.hpp>
24 #include <boost/type_traits/is_base_of.hpp>
25 #include <boost/static_assert.hpp>
27 namespace boost { namespace fusion
29 struct reverse_view_iterator_tag;
31 template <typename First>
32 struct reverse_view_iterator
33 : iterator_base<reverse_view_iterator<First> >
35 typedef convert_iterator<First> converter;
36 typedef typename converter::type first_type;
37 typedef reverse_view_iterator_tag fusion_tag;
38 typedef typename traits::category_of<first_type>::type category;
42 bidirectional_traversal_tag
45 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
46 reverse_view_iterator(First const& in_first)
47 : first(converter::call(in_first)) {}
52 // silence MSVC warning C4512: assignment operator could not be generated
53 reverse_view_iterator& operator= (reverse_view_iterator const&);
57 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
60 template <typename First>
61 struct iterator_traits< ::boost::fusion::reverse_view_iterator<First> >