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_MPL_ITERATOR_05052005_0731)
8 #define FUSION_MPL_ITERATOR_05052005_0731
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/support/detail/mpl_iterator_category.hpp>
12 #include <boost/fusion/iterator/iterator_facade.hpp>
13 #include <boost/type_traits/remove_const.hpp>
14 #include <boost/mpl/deref.hpp>
15 #include <boost/mpl/next.hpp>
16 #include <boost/mpl/prior.hpp>
17 #include <boost/mpl/advance.hpp>
18 #include <boost/mpl/distance.hpp>
20 namespace boost { namespace fusion
22 template <typename Iterator_>
25 mpl_iterator<Iterator_>
26 , typename detail::mpl_iterator_category<typename Iterator_::category>::type
29 typedef typename remove_const<Iterator_>::type iterator_type;
31 template <typename Iterator>
32 struct value_of : mpl::deref<typename Iterator::iterator_type> {};
34 template <typename Iterator>
37 typedef typename mpl::deref<
38 typename Iterator::iterator_type>::type
41 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
49 template <typename Iterator>
53 typename mpl::next<typename Iterator::iterator_type>::type>
56 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
64 template <typename Iterator>
68 typename mpl::prior<typename Iterator::iterator_type>::type>
71 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
79 template <typename Iterator, typename N>
83 typename mpl::advance<typename Iterator::iterator_type, N>::type>
86 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
88 call(Iterator const& /*i*/)
94 template <typename I1, typename I2>
97 typename I1::iterator_type
98 , typename I2::iterator_type>
102 typename I1::iterator_type
103 , typename I2::iterator_type
107 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
109 call(I1 const&, I2 const&)
117 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
120 template <typename Iterator>
121 struct iterator_traits< ::boost::fusion::mpl_iterator<Iterator> >