comparison DEPENDENCIES/generic/include/boost/range/const_iterator.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
9 // 9 //
10 10
11 #ifndef BOOST_RANGE_CONST_ITERATOR_HPP 11 #ifndef BOOST_RANGE_CONST_ITERATOR_HPP
12 #define BOOST_RANGE_CONST_ITERATOR_HPP 12 #define BOOST_RANGE_CONST_ITERATOR_HPP
13 13
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 14 #if defined(_MSC_VER)
15 # pragma once 15 # pragma once
16 #endif 16 #endif
17 17
18 #include <boost/range/config.hpp> 18 #include <boost/range/config.hpp>
19 19
20 #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION 20 #include <boost/range/range_fwd.hpp>
21 #include <boost/range/detail/const_iterator.hpp>
22 #else
23
24 #include <boost/range/detail/extract_optional_type.hpp> 21 #include <boost/range/detail/extract_optional_type.hpp>
25 #include <boost/type_traits/remove_const.hpp> 22 #include <boost/type_traits/remove_const.hpp>
23 #include <boost/type_traits/remove_reference.hpp>
26 #include <cstddef> 24 #include <cstddef>
27 #include <utility> 25 #include <utility>
28 26
29 namespace boost 27 namespace boost
30 { 28 {
31 ////////////////////////////////////////////////////////////////////////// 29 //////////////////////////////////////////////////////////////////////////
32 // default 30 // default
33 ////////////////////////////////////////////////////////////////////////// 31 //////////////////////////////////////////////////////////////////////////
34 32
35 namespace range_detail { 33 namespace range_detail
36 BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator ) 34 {
37 }
38 35
39 template< typename C > 36 BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator )
40 struct range_const_iterator : range_detail::extract_const_iterator<C>
41 {};
42
43 //////////////////////////////////////////////////////////////////////////
44 // pair
45 //////////////////////////////////////////////////////////////////////////
46 37
47 template< typename Iterator > 38 template< typename C >
48 struct range_const_iterator< std::pair<Iterator,Iterator> > 39 struct range_const_iterator
49 { 40 : extract_const_iterator<C>
50 typedef Iterator type; 41 {};
51 };
52
53 //////////////////////////////////////////////////////////////////////////
54 // array
55 //////////////////////////////////////////////////////////////////////////
56 42
57 template< typename T, std::size_t sz > 43 //////////////////////////////////////////////////////////////////////////
58 struct range_const_iterator< T[sz] > 44 // pair
59 { 45 //////////////////////////////////////////////////////////////////////////
60 typedef const T* type; 46
61 }; 47 template< typename Iterator >
48 struct range_const_iterator<std::pair<Iterator,Iterator> >
49 {
50 typedef Iterator type;
51 };
52
53 //////////////////////////////////////////////////////////////////////////
54 // array
55 //////////////////////////////////////////////////////////////////////////
56
57 template< typename T, std::size_t sz >
58 struct range_const_iterator< T[sz] >
59 {
60 typedef const T* type;
61 };
62
63 } // namespace range_detail
64
65 template<typename C, typename Enabler=void>
66 struct range_const_iterator
67 : range_detail::range_const_iterator<
68 BOOST_DEDUCED_TYPENAME remove_reference<C>::type
69 >
70 {
71 };
62 72
63 } // namespace boost 73 } // namespace boost
64 74
65 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
66 75
67 #endif 76 #endif