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
>
27 template <typename Tag
>
31 struct next_impl
<cons_iterator_tag
>
33 template <typename Iterator
>
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
<
43 , mpl::identity
<cdr_type
>
48 call(Iterator
const& i
)
50 return type(i
.cons
.cdr
);