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_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED)
8 #define BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/mpl/assert.hpp>
12 #include <boost/fusion/sequence/intrinsic/segments.hpp>
13 #include <boost/fusion/support/is_segmented.hpp>
14 #include <boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp>
16 namespace boost { namespace fusion
18 struct iterator_range_tag;
22 template <typename Tag>
26 struct segments_impl<iterator_range_tag>
28 template <typename Sequence>
32 detail::make_segmented_range<
33 typename Sequence::begin_type
34 , typename Sequence::end_type
38 BOOST_MPL_ASSERT((traits::is_segmented<typename impl::type>));
41 typename result_of::segments<typename impl::type>::type
44 BOOST_FUSION_GPU_ENABLED
45 static type call(Sequence & seq)
47 return fusion::segments(impl::call(seq.first, seq.last));