1// Boost.Range library
2//
3// Copyright Thorsten Ottosen 2003-2004. Use, modification and
4// distribution is subject to the Boost Software License, Version
5// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7//
8// For more information, see http://www.boost.org/libs/range/
9//
10
11#ifndef BOOST_RANGE_MUTABLE_ITERATOR_HPP
12#define BOOST_RANGE_MUTABLE_ITERATOR_HPP
13
14#if defined(_MSC_VER)
15# pragma once
16#endif
17
18#include <boost/range/config.hpp>
19
20#include <boost/range/range_fwd.hpp>
21#include <boost/range/detail/extract_optional_type.hpp>
22#include <boost/type_traits/remove_reference.hpp>
23#include <boost/iterator/iterator_traits.hpp>
24#include <cstddef>
25#include <utility>
26
27namespace boost
28{
29
30 //////////////////////////////////////////////////////////////////////////
31 // default
32 //////////////////////////////////////////////////////////////////////////
33
34 namespace range_detail
35 {
36
37BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( iterator )
38
39template< typename C >
40struct range_mutable_iterator
41 : range_detail::extract_iterator<
42 BOOST_DEDUCED_TYPENAME remove_reference<C>::type>
43{};
44
45//////////////////////////////////////////////////////////////////////////
46// pair
47//////////////////////////////////////////////////////////////////////////
48
49template< typename Iterator >
50struct range_mutable_iterator< std::pair<Iterator,Iterator> >
51{
52 typedef Iterator type;
53};
54
55//////////////////////////////////////////////////////////////////////////
56// array
57//////////////////////////////////////////////////////////////////////////
58
59template< typename T, std::size_t sz >
60struct range_mutable_iterator< T[sz] >
61{
62 typedef T* type;
63};
64
65 } // namespace range_detail
66
67template<typename C, typename Enabler=void>
68struct range_mutable_iterator
69 : range_detail::range_mutable_iterator<
70 BOOST_DEDUCED_TYPENAME remove_reference<C>::type
71 >
72{
73};
74
75} // namespace boost
76
77#include <boost/range/detail/msvc_has_iterator_workaround.hpp>
78
79#endif
80

source code of include/boost/range/mutable_iterator.hpp