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/mpl/eval_if.hpp>
12 #include <boost/type_traits/is_const.hpp>
13 #include <boost/type_traits/add_const.hpp>
14 #include <boost/type_traits/add_reference.hpp>
16 namespace boost { namespace fusion
18 struct cons_iterator_tag;
22 template <typename Tag>
26 struct deref_impl<cons_iterator_tag>
28 template <typename Iterator>
31 typedef typename Iterator::cons_type cons_type;
32 typedef typename cons_type::car_type value_type;
34 typedef typename mpl::eval_if<
36 , add_reference<typename add_const<value_type>::type>
37 , add_reference<value_type> >::type
41 call(Iterator const& i)