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/mpl/assert.hpp>
11 #include <boost/fusion/sequence/intrinsic/segments.hpp>
12 #include <boost/fusion/support/is_segmented.hpp>
13 #include <boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp>
15 namespace boost { namespace fusion
17 struct iterator_range_tag;
21 template <typename Tag>
25 struct segments_impl<iterator_range_tag>
27 template <typename Sequence>
31 detail::make_segmented_range<
32 typename Sequence::begin_type
33 , typename Sequence::end_type
37 BOOST_MPL_ASSERT((traits::is_segmented<typename impl::type>));
40 typename result_of::segments<typename impl::type>::type
43 static type call(Sequence & seq)
45 return fusion::segments(impl::call(seq.first, seq.last));