]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/adapted/struct/detail/end_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / adapted / struct / detail / end_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
3     Copyright (c) 2005-2006 Dan Marsden
4     Copyright (c) 2009-2010 Christopher Schmidt
5
6     Distributed under the Boost Software License, Version 1.0. (See accompanying
7     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9
10 #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
11 #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
12
13 #include <boost/fusion/iterator/basic_iterator.hpp>
14
15 namespace boost { namespace fusion { namespace extension
16 {
17     template <typename>
18     struct end_impl;
19
20     template <>
21     struct end_impl<struct_tag>
22     {
23         template <typename Seq>
24         struct apply
25         {
26             typedef
27                 basic_iterator<
28                     struct_iterator_tag
29                   , random_access_traversal_tag
30                   , Seq
31                   , struct_size<typename remove_const<Seq>::type>::value
32                 >
33             type;
34
35             static type
36             call(Seq& seq)
37             {
38                 return type(seq,0);
39             }
40         };
41     };
42
43     template <>
44     struct end_impl<assoc_struct_tag>
45     {
46         template <typename Seq>
47         struct apply
48         {
49             typedef
50                 basic_iterator<
51                     struct_iterator_tag
52                   , assoc_struct_category
53                   , Seq
54                   , struct_size<typename remove_const<Seq>::type>::value
55                 >
56             type;
57
58             static type
59             call(Seq& seq)
60             {
61                 return type(seq,0);
62             }
63         };
64     };
65 }}}
66
67 #endif