fix doc example typo
[boost.git] / boost / fusion / container / list / detail / deref_impl.hpp
blob5292dced84921840845fec4b66348c95f6aff7ff
1 /*=============================================================================
2 Copyright (c) 2005 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;
20 namespace extension
22 template <typename Tag>
23 struct deref_impl;
25 template <>
26 struct deref_impl<cons_iterator_tag>
28 template <typename Iterator>
29 struct apply
31 typedef typename Iterator::cons_type cons_type;
32 typedef typename cons_type::car_type value_type;
34 typedef typename mpl::eval_if<
35 is_const<cons_type>
36 , add_reference<typename add_const<value_type>::type>
37 , add_reference<value_type> >::type
38 type;
40 static type
41 call(Iterator const& i)
43 return i.cons.car;
50 #endif