1 | /*============================================================================= |
---|---|
2 | Copyright (c) 2001-2011 Joel de Guzman |
3 | |
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
6 | ==============================================================================*/ |
7 | #if !defined(FUSION_ITERATOR_RANGE_05062005_1224) |
8 | #define FUSION_ITERATOR_RANGE_05062005_1224 |
9 | |
10 | #include <boost/fusion/support/config.hpp> |
11 | #include <boost/fusion/support/detail/access.hpp> |
12 | #include <boost/fusion/support/sequence_base.hpp> |
13 | #include <boost/fusion/support/category_of.hpp> |
14 | #include <boost/fusion/iterator/distance.hpp> |
15 | #include <boost/fusion/iterator/mpl/convert_iterator.hpp> |
16 | #include <boost/fusion/view/iterator_range/detail/begin_impl.hpp> |
17 | #include <boost/fusion/view/iterator_range/detail/end_impl.hpp> |
18 | #include <boost/fusion/view/iterator_range/detail/at_impl.hpp> |
19 | #include <boost/fusion/view/iterator_range/detail/size_impl.hpp> |
20 | #include <boost/fusion/view/iterator_range/detail/value_at_impl.hpp> |
21 | #include <boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp> |
22 | #include <boost/fusion/view/iterator_range/detail/segments_impl.hpp> |
23 | #include <boost/fusion/adapted/mpl/mpl_iterator.hpp> |
24 | #include <boost/config.hpp> |
25 | |
26 | #if defined (BOOST_MSVC) |
27 | # pragma warning(push) |
28 | # pragma warning (disable: 4512) // assignment operator could not be generated. |
29 | #endif |
30 | |
31 | namespace boost { namespace fusion |
32 | { |
33 | struct iterator_range_tag; |
34 | struct fusion_sequence_tag; |
35 | |
36 | template <typename First, typename Last> |
37 | struct iterator_range : sequence_base<iterator_range<First, Last> > |
38 | { |
39 | typedef typename convert_iterator<First>::type begin_type; |
40 | typedef typename convert_iterator<Last>::type end_type; |
41 | typedef iterator_range_tag fusion_tag; |
42 | typedef fusion_sequence_tag tag; // this gets picked up by MPL |
43 | typedef mpl::true_ is_view; |
44 | |
45 | typedef typename traits::category_of<begin_type>::type category; |
46 | |
47 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
48 | iterator_range(First const& in_first, Last const& in_last) |
49 | : first(convert_iterator<First>::call(in_first)) |
50 | , last(convert_iterator<Last>::call(in_last)) {} |
51 | |
52 | begin_type first; |
53 | end_type last; |
54 | }; |
55 | }} |
56 | |
57 | #if defined (BOOST_MSVC) |
58 | # pragma warning(pop) |
59 | #endif |
60 | |
61 | #endif |
62 | |
63 | |
64 |