1 /*=============================================================================
2 Copyright (c) 2011 Eric Niebler
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(BOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED)
8 #define BOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED
10 #include <boost/mpl/bool.hpp>
11 #include <boost/type_traits/remove_reference.hpp>
12 #include <boost/fusion/support/tag_of.hpp>
13 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
15 namespace boost { namespace fusion { namespace detail
17 struct segment_sequence_tag {};
19 // Here, Sequence is a sequence of ranges (which may or may not be
21 template<typename Sequence>
22 struct segment_sequence
23 : sequence_base<segment_sequence<Sequence> >
25 typedef fusion_sequence_tag tag;
26 typedef segment_sequence_tag fusion_tag;
27 typedef typename Sequence::is_view is_view;
28 typedef typename Sequence::category category;
29 typedef Sequence sequence_type;
30 sequence_type sequence;
32 explicit segment_sequence(Sequence const & seq)
40 template<typename Tag>
41 struct is_segmented_impl;
44 struct is_segmented_impl<detail::segment_sequence_tag>
46 template<typename Sequence>
52 template<typename Tag>
56 struct segments_impl<detail::segment_sequence_tag>
58 template<typename Sequence>
61 typedef typename Sequence::sequence_type type;
63 static type call(Sequence & seq)