comparison DEPENDENCIES/generic/include/boost/fusion/iterator/next.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_NEXT_05042005_1101)
8 #define FUSION_NEXT_05042005_1101
9
10 #include <boost/fusion/support/tag_of.hpp>
11
12 namespace boost { namespace fusion
13 {
14 // Special tags:
15 struct iterator_facade_tag; // iterator facade tag
16 struct boost_array_iterator_tag; // boost::array iterator tag
17 struct mpl_iterator_tag; // mpl sequence iterator tag
18 struct std_pair_iterator_tag; // std::pair iterator tag
19
20 namespace extension
21 {
22 template <typename Tag>
23 struct next_impl
24 {
25 template <typename Iterator>
26 struct apply {};
27 };
28
29 template <>
30 struct next_impl<iterator_facade_tag>
31 {
32 template <typename Iterator>
33 struct apply : Iterator::template next<Iterator> {};
34 };
35
36 template <>
37 struct next_impl<boost_array_iterator_tag>;
38
39 template <>
40 struct next_impl<mpl_iterator_tag>;
41
42 template <>
43 struct next_impl<std_pair_iterator_tag>;
44 }
45
46 namespace result_of
47 {
48 template <typename Iterator>
49 struct next
50 : extension::next_impl<typename detail::tag_of<Iterator>::type>::
51 template apply<Iterator>
52 {};
53 }
54
55 template <typename Iterator>
56 typename result_of::next<Iterator>::type const
57 next(Iterator const& i)
58 {
59 return result_of::next<Iterator>::call(i);
60 }
61 }}
62
63 #endif