fix doc example typo
[boost.git] / boost / fusion / container / list / detail / next_impl.hpp
blobdafa83cc8c7092711c2ab3167a6d53a3221524b8
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_NEXT_IMPL_07172005_0836)
9 #define FUSION_NEXT_IMPL_07172005_0836
11 #include <boost/fusion/iterator/next.hpp>
12 #include <boost/fusion/iterator/equal_to.hpp>
13 #include <boost/mpl/eval_if.hpp>
14 #include <boost/mpl/identity.hpp>
15 #include <boost/type_traits/is_const.hpp>
16 #include <boost/type_traits/add_const.hpp>
18 namespace boost { namespace fusion
20 struct cons_iterator_tag;
22 template <typename Cons>
23 struct cons_iterator;
25 namespace extension
27 template <typename Tag>
28 struct next_impl;
30 template <>
31 struct next_impl<cons_iterator_tag>
33 template <typename Iterator>
34 struct apply
36 typedef typename Iterator::cons_type cons_type;
37 typedef typename cons_type::cdr_type cdr_type;
39 typedef cons_iterator<
40 typename mpl::eval_if<
41 is_const<cons_type>
42 , add_const<cdr_type>
43 , mpl::identity<cdr_type>
44 >::type>
45 type;
47 static type
48 call(Iterator const& i)
50 return type(i.cons.cdr);
57 #endif