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_DEREF_05042005_1019)
8 #define FUSION_DEREF_05042005_1019
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/support/iterator_base.hpp>
12 #include <boost/fusion/support/tag_of.hpp>
14 namespace boost { namespace fusion
17 struct iterator_facade_tag; // iterator facade tag
18 struct boost_array_iterator_tag; // boost::array iterator tag
19 struct mpl_iterator_tag; // mpl sequence iterator tag
20 struct std_pair_iterator_tag; // std::pair iterator tag
24 template <typename Tag>
27 template <typename Iterator>
32 struct deref_impl<iterator_facade_tag>
34 template <typename Iterator>
35 struct apply : Iterator::template deref<Iterator> {};
39 struct deref_impl<boost_array_iterator_tag>;
42 struct deref_impl<mpl_iterator_tag>;
45 struct deref_impl<std_pair_iterator_tag>;
50 template <typename Iterator>
52 : extension::deref_impl<typename detail::tag_of<Iterator>::type>::
53 template apply<Iterator>
57 template <typename Iterator>
58 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
59 inline typename result_of::deref<Iterator>::type
60 deref(Iterator const& i)
62 typedef result_of::deref<Iterator> deref_meta;
63 return deref_meta::call(i);
66 template <typename Iterator>
67 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
68 inline typename result_of::deref<Iterator>::type
69 operator*(iterator_base<Iterator> const& i)
71 return fusion::deref(i.cast());