The C and C++ Include Header Files
/usr/include/c++/11/debug/stl_iterator.h
$ cat -n /usr/include/c++/11/debug/stl_iterator.h 1 // Debugging support implementation -*- C++ -*- 2 3 // Copyright (C) 2015-2021 Free Software Foundation, Inc. 4 // 5 // This file is part of the GNU ISO C++ Library. This library is free 6 // software; you can redistribute it and/or modify it under the 7 // terms of the GNU General Public License as published by the 8 // Free Software Foundation; either version 3, or (at your option) 9 // any later version. 10 11 // This library is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 16 // Under Section 7 of GPL version 3, you are granted additional 17 // permissions described in the GCC Runtime Library Exception, version 18 // 3.1, as published by the Free Software Foundation. 19 20 // You should have received a copy of the GNU General Public License and 21 // a copy of the GCC Runtime Library Exception along with this program; 22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23 //
. 24 25 /** @file debug/stl_iterator.h 26 * This file is a GNU debug extension to the Standard C++ Library. 27 */ 28 29 #ifndef _GLIBCXX_DEBUG_STL_ITERATOR_H 30 #define _GLIBCXX_DEBUG_STL_ITERATOR_H 1 31 32 #include
33 34 namespace __gnu_debug 35 { 36 // Help Debug mode to see through reverse_iterator. 37 template
38 _GLIBCXX20_CONSTEXPR 39 inline bool 40 __valid_range(const std::reverse_iterator<_Iterator>& __first, 41 const std::reverse_iterator<_Iterator>& __last, 42 typename _Distance_traits<_Iterator>::__type& __dist) 43 { 44 return __gnu_debug::__valid_range(__last.base(), __first.base(), __dist); 45 } 46 47 template
48 _GLIBCXX20_CONSTEXPR 49 inline typename _Distance_traits<_Iterator>::__type 50 __get_distance(const std::reverse_iterator<_Iterator>& __first, 51 const std::reverse_iterator<_Iterator>& __last) 52 { return __gnu_debug::__get_distance(__last.base(), __first.base()); } 53 54 template
55 _GLIBCXX20_CONSTEXPR 56 inline bool 57 __can_advance(const std::reverse_iterator<_Iterator>& __it, _Size __n) 58 { return __gnu_debug::__can_advance(__it.base(), -__n); } 59 60 template
61 _GLIBCXX20_CONSTEXPR 62 inline bool 63 __can_advance(const std::reverse_iterator<_Iterator>& __it, 64 const std::pair<_Diff, _Distance_precision>& __dist, 65 int __way) 66 { return __gnu_debug::__can_advance(__it.base(), __dist, -__way); } 67 68 template
69 _GLIBCXX20_CONSTEXPR 70 inline std::reverse_iterator<_Iterator> 71 __base(const std::reverse_iterator<_Safe_iterator< 72 _Iterator, _Sequence, std::random_access_iterator_tag> >& __it) 73 { return std::reverse_iterator<_Iterator>(__it.base().base()); } 74 75 #if __cplusplus < 201103L 76 template
77 struct _Unsafe_type
> 78 { 79 typedef typename _Unsafe_type<_Iterator>::_Type _UnsafeType; 80 typedef std::reverse_iterator<_UnsafeType> _Type; 81 }; 82 83 template
84 inline std::reverse_iterator
::_Type> 85 __unsafe(const std::reverse_iterator<_Iterator>& __it) 86 { 87 typedef typename _Unsafe_type<_Iterator>::_Type _UnsafeType; 88 return std::reverse_iterator<_UnsafeType>(__unsafe(__it.base())); 89 } 90 #else 91 template
92 _GLIBCXX20_CONSTEXPR 93 inline auto 94 __unsafe(const std::reverse_iterator<_Iterator>& __it) 95 -> decltype(std::__make_reverse_iterator(__unsafe(__it.base()))) 96 { return std::__make_reverse_iterator(__unsafe(__it.base())); } 97 #endif 98 99 #if __cplusplus >= 201103L 100 // Help Debug mode to see through move_iterator. 101 template
102 _GLIBCXX20_CONSTEXPR 103 inline bool 104 __valid_range(const std::move_iterator<_Iterator>& __first, 105 const std::move_iterator<_Iterator>& __last, 106 typename _Distance_traits<_Iterator>::__type& __dist) 107 { 108 return __gnu_debug::__valid_range(__first.base(), __last.base(), __dist); 109 } 110 111 template
112 _GLIBCXX20_CONSTEXPR 113 inline typename _Distance_traits<_Iterator>::__type 114 __get_distance(const std::move_iterator<_Iterator>& __first, 115 const std::move_iterator<_Iterator>& __last) 116 { return __gnu_debug::__get_distance(__first.base(), __last.base()); } 117 118 template
119 _GLIBCXX20_CONSTEXPR 120 inline bool 121 __can_advance(const std::move_iterator<_Iterator>& __it, _Size __n) 122 { return __gnu_debug::__can_advance(__it.base(), __n); } 123 124 template
125 _GLIBCXX20_CONSTEXPR 126 inline bool 127 __can_advance(const std::move_iterator<_Iterator>& __it, 128 const std::pair<_Diff, _Distance_precision>& __dist, 129 int __way) 130 { return __gnu_debug::__can_advance(__it.base(), __dist, __way); } 131 132 template
133 _GLIBCXX20_CONSTEXPR 134 inline auto 135 __unsafe(const std::move_iterator<_Iterator>& __it) 136 -> decltype(std::make_move_iterator(__unsafe(__it.base()))) 137 { return std::make_move_iterator(__unsafe(__it.base())); } 138 139 template
140 _GLIBCXX20_CONSTEXPR 141 inline auto 142 __base(const std::move_iterator<_Iterator>& __it) 143 -> decltype(std::make_move_iterator(__base(__it.base()))) 144 { return std::make_move_iterator(__base(__it.base())); } 145 #endif 146 } 147 148 #endif
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2024 MyWebUniversity.com ™