]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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/support/config.hpp> | |
14 | #include <boost/fusion/iterator/basic_iterator.hpp> | |
15 | ||
16 | namespace boost { namespace fusion { namespace extension | |
17 | { | |
18 | template <typename> | |
19 | struct end_impl; | |
20 | ||
21 | template <> | |
22 | struct end_impl<struct_tag> | |
23 | { | |
24 | template <typename Seq> | |
25 | struct apply | |
26 | { | |
27 | typedef | |
28 | basic_iterator< | |
29 | struct_iterator_tag | |
30 | , random_access_traversal_tag | |
31 | , Seq | |
32 | , struct_size<typename remove_const<Seq>::type>::value | |
33 | > | |
34 | type; | |
35 | ||
36 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
37 | static type | |
38 | call(Seq& seq) | |
39 | { | |
40 | return type(seq,0); | |
41 | } | |
42 | }; | |
43 | }; | |
44 | ||
45 | template <> | |
46 | struct end_impl<assoc_struct_tag> | |
47 | { | |
48 | template <typename Seq> | |
49 | struct apply | |
50 | { | |
51 | typedef | |
52 | basic_iterator< | |
53 | struct_iterator_tag | |
54 | , assoc_struct_category | |
55 | , Seq | |
56 | , struct_size<typename remove_const<Seq>::type>::value | |
57 | > | |
58 | type; | |
59 | ||
60 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
61 | static type | |
62 | call(Seq& seq) | |
63 | { | |
64 | return type(seq,0); | |
65 | } | |
66 | }; | |
67 | }; | |
68 | }}} | |
69 | ||
70 | #endif |