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/fusion/support/config.hpp>
11 #include <boost/mpl/bool.hpp>
12 #include <boost/type_traits/remove_reference.hpp>
13 #include <boost/fusion/support/tag_of.hpp>
14 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
16 namespace boost { namespace fusion { namespace detail
18 struct segment_sequence_tag {};
20 // Here, Sequence is a sequence of ranges (which may or may not be
22 template<typename Sequence>
23 struct segment_sequence
24 : sequence_base<segment_sequence<Sequence> >
26 typedef fusion_sequence_tag tag;
27 typedef segment_sequence_tag fusion_tag;
28 typedef typename Sequence::is_view is_view;
29 typedef typename Sequence::category category;
30 typedef Sequence sequence_type;
31 sequence_type sequence;
33 BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
41 template<typename Tag>
42 struct is_segmented_impl;
45 struct is_segmented_impl<detail::segment_sequence_tag>
47 template<typename Sequence>
53 template<typename Tag>
57 struct segments_impl<detail::segment_sequence_tag>
59 template<typename Sequence>
62 typedef typename Sequence::sequence_type type;
64 BOOST_FUSION_GPU_ENABLED
65 static type call(Sequence & seq)