]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/view/iterator_range/detail/segments_impl.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / view / iterator_range / detail / segments_impl.hpp
1 /*=============================================================================
2     Copyright (c) 2011 Eric Niebler
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(BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED)
8 #define BOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED
9
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>
14
15 namespace boost { namespace fusion
16 {
17     struct iterator_range_tag;
18
19     namespace extension
20     {
21         template <typename Tag>
22         struct segments_impl;
23
24         template <>
25         struct segments_impl<iterator_range_tag>
26         {
27             template <typename Sequence>
28             struct apply
29             {
30                 typedef
31                     detail::make_segmented_range<
32                         typename Sequence::begin_type
33                       , typename Sequence::end_type
34                     >
35                 impl;
36
37                 BOOST_MPL_ASSERT((traits::is_segmented<typename impl::type>));
38
39                 typedef
40                     typename result_of::segments<typename impl::type>::type
41                 type;
42
43                 static type call(Sequence & seq)
44                 {
45                     return fusion::segments(impl::call(seq.first, seq.last));
46                 }
47             };
48         };
49     }
50 }}
51
52 #endif