source: NonGTP/Boost/boost/spirit/fusion/sequence/detail/single_view_begin_end_trts.hpp @ 857

Revision 857, 2.6 KB checked in by igarcia, 18 years ago (diff)
Line 
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_SINGLE_VIEW_BEGIN_END_TRAITS_HPP)
9#define FUSION_SEQUENCE_DETAIL_SINGLE_VIEW_BEGIN_END_TRAITS_HPP
10
11#include <boost/spirit/fusion/detail/config.hpp>
12
13namespace boost { namespace fusion
14{
15    struct single_view_tag;
16
17    template <typename T>
18    struct single_view_iterator_end;
19
20    template <typename T>
21    struct single_view_iterator;
22
23    namespace single_view_detail
24    {
25        template <typename Sequence>
26        struct begin_traits_impl
27        {
28            typedef single_view_iterator<Sequence> type;
29
30            static type
31            call(Sequence& s);
32        };
33
34        template <typename Sequence>
35        inline typename begin_traits_impl<Sequence>::type
36        begin_traits_impl<Sequence>::call(Sequence& s)
37        {
38            return type(s);
39        }
40
41        template <typename Sequence>
42        struct end_traits_impl
43        {
44            typedef single_view_iterator_end<Sequence> type;
45
46            static type
47            call(Sequence&);
48        };
49
50        template <typename Sequence>
51        inline typename end_traits_impl<Sequence>::type
52        end_traits_impl<Sequence>::call(Sequence&)
53        {
54            FUSION_RETURN_DEFAULT_CONSTRUCTED;
55        }
56    }
57
58    namespace meta
59    {
60        template <typename Tag>
61        struct begin_impl;
62
63        template <>
64        struct begin_impl<single_view_tag>
65        {
66            template <typename Sequence>
67            struct apply : single_view_detail::begin_traits_impl<Sequence> {};
68        };
69
70        template <typename Tag>
71        struct end_impl;
72
73        template <>
74        struct end_impl<single_view_tag>
75        {
76            template <typename Sequence>
77            struct apply : single_view_detail::end_traits_impl<Sequence> {};
78        };
79    }
80}}
81
82namespace boost { namespace mpl
83{
84    template <typename Tag>
85    struct begin_impl;
86
87    template <typename Tag>
88    struct end_impl;
89
90    template <>
91    struct begin_impl<fusion::single_view_tag>
92        : fusion::meta::begin_impl<fusion::single_view_tag> {};
93
94    template <>
95    struct end_impl<fusion::single_view_tag>
96        : fusion::meta::end_impl<fusion::single_view_tag> {};
97}}
98
99#endif
100
101
Note: See TracBrowser for help on using the repository browser.