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_MUTABLE_ITERATOR_HPP
|
Chris@16
|
12 #define BOOST_RANGE_MUTABLE_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@16
|
19
|
Chris@101
|
20 #include <boost/range/range_fwd.hpp>
|
Chris@16
|
21 #include <boost/range/detail/extract_optional_type.hpp>
|
Chris@101
|
22 #include <boost/type_traits/remove_reference.hpp>
|
Chris@16
|
23 #include <boost/iterator/iterator_traits.hpp>
|
Chris@16
|
24 #include <cstddef>
|
Chris@16
|
25 #include <utility>
|
Chris@16
|
26
|
Chris@16
|
27 namespace boost
|
Chris@16
|
28 {
|
Chris@101
|
29
|
Chris@16
|
30 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
31 // default
|
Chris@16
|
32 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
33
|
Chris@101
|
34 namespace range_detail
|
Chris@101
|
35 {
|
Chris@16
|
36
|
Chris@101
|
37 BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( iterator )
|
Chris@16
|
38
|
Chris@101
|
39 template< typename C >
|
Chris@101
|
40 struct range_mutable_iterator
|
Chris@101
|
41 : range_detail::extract_iterator<
|
Chris@101
|
42 BOOST_DEDUCED_TYPENAME remove_reference<C>::type>
|
Chris@101
|
43 {};
|
Chris@16
|
44
|
Chris@101
|
45 //////////////////////////////////////////////////////////////////////////
|
Chris@101
|
46 // pair
|
Chris@101
|
47 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
48
|
Chris@101
|
49 template< typename Iterator >
|
Chris@101
|
50 struct range_mutable_iterator< std::pair<Iterator,Iterator> >
|
Chris@101
|
51 {
|
Chris@101
|
52 typedef Iterator type;
|
Chris@101
|
53 };
|
Chris@101
|
54
|
Chris@101
|
55 //////////////////////////////////////////////////////////////////////////
|
Chris@101
|
56 // array
|
Chris@101
|
57 //////////////////////////////////////////////////////////////////////////
|
Chris@101
|
58
|
Chris@101
|
59 template< typename T, std::size_t sz >
|
Chris@101
|
60 struct range_mutable_iterator< T[sz] >
|
Chris@101
|
61 {
|
Chris@101
|
62 typedef T* type;
|
Chris@101
|
63 };
|
Chris@101
|
64
|
Chris@101
|
65 } // namespace range_detail
|
Chris@101
|
66
|
Chris@101
|
67 template<typename C, typename Enabler=void>
|
Chris@101
|
68 struct range_mutable_iterator
|
Chris@101
|
69 : range_detail::range_mutable_iterator<
|
Chris@101
|
70 BOOST_DEDUCED_TYPENAME remove_reference<C>::type
|
Chris@101
|
71 >
|
Chris@101
|
72 {
|
Chris@101
|
73 };
|
Chris@16
|
74
|
Chris@16
|
75 } // namespace boost
|
Chris@16
|
76
|
Chris@101
|
77 #include <boost/range/detail/msvc_has_iterator_workaround.hpp>
|
Chris@16
|
78
|
Chris@16
|
79 #endif
|