Chris@16
|
1 // Boost.Range library
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright Thorsten Ottosen 2003-2004. Use, modification and
|
Chris@16
|
4 // distribution is subject to the Boost Software License, Version
|
Chris@16
|
5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
6 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 //
|
Chris@16
|
8 // For more information, see http://www.boost.org/libs/range/
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_RANGE_ITERATOR_HPP
|
Chris@16
|
12 #define BOOST_RANGE_ITERATOR_HPP
|
Chris@16
|
13
|
Chris@101
|
14 #if defined(_MSC_VER)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/range/config.hpp>
|
Chris@101
|
19 #include <boost/range/range_fwd.hpp>
|
Chris@16
|
20 #include <boost/range/mutable_iterator.hpp>
|
Chris@16
|
21 #include <boost/range/const_iterator.hpp>
|
Chris@16
|
22 #include <boost/type_traits/is_const.hpp>
|
Chris@16
|
23 #include <boost/type_traits/remove_const.hpp>
|
Chris@16
|
24 #include <boost/mpl/eval_if.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost
|
Chris@16
|
27 {
|
Chris@16
|
28
|
Chris@101
|
29 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
Chris@16
|
30
|
Chris@101
|
31 namespace range_detail_vc7_1
|
Chris@101
|
32 {
|
Chris@101
|
33 template< typename C, typename Sig = void(C) >
|
Chris@101
|
34 struct range_iterator
|
Chris@101
|
35 {
|
Chris@101
|
36 typedef BOOST_RANGE_DEDUCED_TYPENAME
|
Chris@101
|
37 mpl::eval_if_c< is_const<C>::value,
|
Chris@101
|
38 range_const_iterator< typename remove_const<C>::type >,
|
Chris@101
|
39 range_mutable_iterator<C> >::type type;
|
Chris@101
|
40 };
|
Chris@101
|
41
|
Chris@101
|
42 template< typename C, typename T >
|
Chris@101
|
43 struct range_iterator< C, void(T[]) >
|
Chris@101
|
44 {
|
Chris@101
|
45 typedef T* type;
|
Chris@101
|
46 };
|
Chris@101
|
47 }
|
Chris@101
|
48
|
Chris@101
|
49 #endif
|
Chris@16
|
50
|
Chris@101
|
51 template< typename C, typename Enabler=void >
|
Chris@16
|
52 struct range_iterator
|
Chris@16
|
53 {
|
Chris@16
|
54 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
Chris@101
|
55
|
Chris@101
|
56 typedef BOOST_RANGE_DEDUCED_TYPENAME
|
Chris@101
|
57 range_detail_vc7_1::range_iterator<C>::type type;
|
Chris@101
|
58
|
Chris@101
|
59 #else
|
Chris@16
|
60
|
Chris@101
|
61 private:
|
Chris@101
|
62 typedef typename remove_reference<C>::type param_t;
|
Chris@16
|
63
|
Chris@101
|
64 public:
|
Chris@101
|
65 typedef typename mpl::eval_if_c<
|
Chris@101
|
66 is_const<param_t>::value,
|
Chris@101
|
67 range_const_iterator<typename remove_const<param_t>::type>,
|
Chris@101
|
68 range_mutable_iterator<param_t>
|
Chris@101
|
69 >::type type;
|
Chris@101
|
70
|
Chris@101
|
71 #endif
|
Chris@101
|
72 };
|
Chris@101
|
73
|
Chris@101
|
74 } // namespace boost
|
Chris@16
|
75
|
Chris@16
|
76 #endif
|