1 | /*=============================================================================
|
---|
2 | Copyright (c) 2003 Joel de Guzman
|
---|
3 |
|
---|
4 | Use, modification and distribution is subject to the Boost Software
|
---|
5 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
6 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
7 | ==============================================================================*/
|
---|
8 | #if !defined(FUSION_SEQUENCE_DETAIL_TYPE_SEQUENCE_BEGIN_END_TRAITS_HPP)
|
---|
9 | #define FUSION_SEQUENCE_DETAIL_TYPE_SEQUENCE_BEGIN_END_TRAITS_HPP
|
---|
10 |
|
---|
11 | #include <boost/spirit/fusion/detail/config.hpp>
|
---|
12 | #include <boost/mpl/begin_end.hpp>
|
---|
13 |
|
---|
14 | namespace boost { namespace fusion
|
---|
15 | {
|
---|
16 | template <typename Iterator>
|
---|
17 | struct type_sequence_iterator;
|
---|
18 |
|
---|
19 | struct type_sequence_tag;
|
---|
20 |
|
---|
21 | template <typename SequenceT>
|
---|
22 | struct type_sequence;
|
---|
23 |
|
---|
24 | namespace meta
|
---|
25 | {
|
---|
26 | template <typename Tag>
|
---|
27 | struct begin_impl;
|
---|
28 |
|
---|
29 | template <>
|
---|
30 | struct begin_impl<type_sequence_tag>
|
---|
31 | {
|
---|
32 | template <typename Sequence>
|
---|
33 | struct apply
|
---|
34 | {
|
---|
35 | typedef type_sequence_iterator<
|
---|
36 | typename mpl::begin<typename Sequence::sequence_type>::type>
|
---|
37 | type;
|
---|
38 |
|
---|
39 | static type
|
---|
40 | call(Sequence)
|
---|
41 | {
|
---|
42 | FUSION_RETURN_DEFAULT_CONSTRUCTED;
|
---|
43 | }
|
---|
44 | };
|
---|
45 | };
|
---|
46 |
|
---|
47 | template <typename Tag>
|
---|
48 | struct end_impl;
|
---|
49 |
|
---|
50 | template <>
|
---|
51 | struct end_impl<type_sequence_tag>
|
---|
52 | {
|
---|
53 | template <typename Sequence>
|
---|
54 | struct apply
|
---|
55 | {
|
---|
56 | typedef type_sequence_iterator<
|
---|
57 | typename mpl::end<typename Sequence::sequence_type>::type>
|
---|
58 | type;
|
---|
59 |
|
---|
60 | static type
|
---|
61 | call(Sequence)
|
---|
62 | {
|
---|
63 | FUSION_RETURN_DEFAULT_CONSTRUCTED;
|
---|
64 | }
|
---|
65 | };
|
---|
66 | };
|
---|
67 | }
|
---|
68 | }}
|
---|
69 |
|
---|
70 | namespace boost { namespace mpl
|
---|
71 | {
|
---|
72 | template <typename Tag>
|
---|
73 | struct begin_impl;
|
---|
74 |
|
---|
75 | template <typename Tag>
|
---|
76 | struct end_impl;
|
---|
77 |
|
---|
78 | template <>
|
---|
79 | struct begin_impl<fusion::type_sequence_tag>
|
---|
80 | : fusion::meta::begin_impl<fusion::type_sequence_tag> {};
|
---|
81 |
|
---|
82 | template <>
|
---|
83 | struct end_impl<fusion::type_sequence_tag>
|
---|
84 | : fusion::meta::end_impl<fusion::type_sequence_tag> {};
|
---|
85 | }}
|
---|
86 |
|
---|
87 | #endif
|
---|
88 |
|
---|
89 |
|
---|