]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/container/list/detail/next_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / container / list / detail / next_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
3     Copyright (c) 2005 Eric Niebler
4
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
10
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>
17
18 namespace boost { namespace fusion
19 {
20     struct cons_iterator_tag;
21
22     template <typename Cons>
23     struct cons_iterator;
24
25     namespace extension
26     {
27         template <typename Tag>
28         struct next_impl;
29
30         template <>
31         struct next_impl<cons_iterator_tag>
32         {
33             template <typename Iterator>
34             struct apply
35             {
36                 typedef typename Iterator::cons_type cons_type;
37                 typedef typename cons_type::cdr_type cdr_type;
38     
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;
46     
47                 static type
48                 call(Iterator const& i)
49                 {
50                     return type(i.cons.cdr);
51                 }
52             };
53         };
54     }
55 }}
56
57 #endif
58
59