59 #ifndef _STL_ITERATOR_BASE_TYPES_H 60 #define _STL_ITERATOR_BASE_TYPES_H 1 62 #pragma GCC system_header 66 #if __cplusplus >= 201103L 70 namespace std _GLIBCXX_VISIBILITY(default)
72 _GLIBCXX_BEGIN_NAMESPACE_VERSION
116 template<
typename _Category,
typename _Tp,
typename _Distance = ptrdiff_t,
117 typename _Pointer = _Tp*,
typename _Reference = _Tp&>
140 #if __cplusplus >= 201103L 143 template<
typename _Iterator,
typename = __
void_t<>>
146 template<
typename _Iterator>
148 __void_t<typename _Iterator::iterator_category,
149 typename _Iterator::value_type,
150 typename _Iterator::difference_type,
151 typename _Iterator::pointer,
152 typename _Iterator::reference>>
154 typedef typename _Iterator::iterator_category iterator_category;
155 typedef typename _Iterator::value_type value_type;
156 typedef typename _Iterator::difference_type difference_type;
157 typedef typename _Iterator::pointer pointer;
158 typedef typename _Iterator::reference reference;
161 template<
typename _Iterator>
162 struct iterator_traits
165 template<
typename _Iterator>
166 struct iterator_traits
168 typedef typename _Iterator::iterator_category iterator_category;
169 typedef typename _Iterator::value_type value_type;
170 typedef typename _Iterator::difference_type difference_type;
171 typedef typename _Iterator::pointer pointer;
172 typedef typename _Iterator::reference reference;
177 template<
typename _Tp>
178 struct iterator_traits<_Tp*>
181 typedef _Tp value_type;
182 typedef ptrdiff_t difference_type;
183 typedef _Tp* pointer;
184 typedef _Tp& reference;
188 template<
typename _Tp>
189 struct iterator_traits<const _Tp*>
192 typedef _Tp value_type;
193 typedef ptrdiff_t difference_type;
194 typedef const _Tp* pointer;
195 typedef const _Tp& reference;
202 template<
typename _Iter>
203 inline typename iterator_traits<_Iter>::iterator_category
205 {
return typename iterator_traits<_Iter>::iterator_category(); }
211 template<
typename _Iterator,
bool _HasBase>
214 typedef _Iterator iterator_type;
215 static iterator_type _S_base(_Iterator __it)
219 template<
typename _Iterator>
220 struct _Iter_base<_Iterator, true>
222 typedef typename _Iterator::iterator_type iterator_type;
223 static iterator_type _S_base(_Iterator __it)
224 {
return __it.base(); }
227 #if __cplusplus >= 201103L 228 template<
typename _InIter>
229 using _RequireInputIter =
typename 230 enable_if<is_convertible<
typename 231 iterator_traits<_InIter>::iterator_category,
235 _GLIBCXX_END_NAMESPACE_VERSION
_Tp value_type
The type "pointed to" by the iterator.
_Reference reference
This type represents a reference-to-value_type.
Marking output iterators.
_Distance difference_type
Distance between iterators is represented as this type.
Bidirectional iterators support a superset of forward iterator operations.
Random-access iterators support a superset of bidirectional iterator operations.
_Pointer pointer
This type represents a pointer-to-value_type.
iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
Traits class for iterators.
Forward iterators support a superset of input iterator operations.
ISO C++ entities toplevel namespace is std.
_Category iterator_category
One of the tag types.