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_FILTER_VIEW_HPP)
|
---|
9 | #define FUSION_SEQUENCE_FILTER_VIEW_HPP
|
---|
10 |
|
---|
11 | #include <boost/spirit/fusion/detail/access.hpp>
|
---|
12 | #include <boost/spirit/fusion/iterator/filter_view_iterator.hpp>
|
---|
13 | #include <boost/spirit/fusion/sequence/detail/filter_view_begin_end_trts.hpp>
|
---|
14 | #include <boost/spirit/fusion/sequence/detail/sequence_base.hpp>
|
---|
15 | #include <boost/spirit/fusion/sequence/as_fusion_sequence.hpp>
|
---|
16 | #include <boost/spirit/fusion/sequence/begin.hpp>
|
---|
17 | #include <boost/spirit/fusion/sequence/end.hpp>
|
---|
18 |
|
---|
19 | namespace boost { namespace fusion
|
---|
20 | {
|
---|
21 | struct filter_view_tag;
|
---|
22 |
|
---|
23 | template <typename Sequence, typename Pred>
|
---|
24 | struct filter_view : sequence_base<filter_view<Sequence, Pred> >
|
---|
25 | {
|
---|
26 | typedef as_fusion_sequence<Sequence> seq_converter;
|
---|
27 | typedef typename seq_converter::type seq;
|
---|
28 |
|
---|
29 | typedef filter_view_tag tag;
|
---|
30 | typedef typename meta::begin<seq>::type first_type;
|
---|
31 | typedef typename meta::end<seq>::type last_type;
|
---|
32 | typedef Pred pred_type;
|
---|
33 |
|
---|
34 | filter_view(Sequence& seq)
|
---|
35 | : first(fusion::begin(seq))
|
---|
36 | , last(fusion::end(seq))
|
---|
37 | {}
|
---|
38 |
|
---|
39 | first_type first;
|
---|
40 | last_type last;
|
---|
41 | };
|
---|
42 | }}
|
---|
43 |
|
---|
44 | #endif
|
---|
45 |
|
---|
46 |
|
---|