1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2005 Eric Niebler
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(FUSION_DEREF_IMPL_07172005_0831)
9 #define FUSION_DEREF_IMPL_07172005_0831
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/mpl/eval_if.hpp>
13 #include <boost/type_traits/is_const.hpp>
14 #include <boost/type_traits/add_const.hpp>
15 #include <boost/type_traits/add_reference.hpp>
17 namespace boost { namespace fusion
19 struct cons_iterator_tag;
23 template <typename Tag>
27 struct deref_impl<cons_iterator_tag>
29 template <typename Iterator>
32 typedef typename Iterator::cons_type cons_type;
33 typedef typename cons_type::car_type value_type;
35 typedef typename mpl::eval_if<
37 , add_reference<typename add_const<value_type>::type>
38 , add_reference<value_type> >::type
41 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
43 call(Iterator const& i)