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#if __cplusplus > 201703L && __cpp_concepts >= 201907L
74namespace std _GLIBCXX_VISIBILITY(default)
76_GLIBCXX_BEGIN_NAMESPACE_VERSION
109#if __cplusplus > 201703L
125 template<
typename _Category,
typename _Tp,
typename _Distance = ptrdiff_t,
126 typename _Pointer = _Tp*,
typename _Reference = _Tp&>
149 template<
typename _Iterator>
152#if __cplusplus >= 201103L
155 template<
typename _Iterator,
typename = __
void_t<>>
156 struct __iterator_traits { };
158#if ! __cpp_lib_concepts
160 template<
typename _Iterator>
161 struct __iterator_traits<_Iterator,
162 __void_t<typename _Iterator::iterator_category,
163 typename _Iterator::value_type,
164 typename _Iterator::difference_type,
165 typename _Iterator::pointer,
166 typename _Iterator::reference>>
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;
176 template<
typename _Iterator>
178 :
public __iterator_traits<_Iterator> { };
181 template<
typename _Iterator>
184 typedef typename _Iterator::iterator_category iterator_category;
185 typedef typename _Iterator::value_type value_type;
186 typedef typename _Iterator::difference_type difference_type;
187 typedef typename _Iterator::pointer pointer;
188 typedef typename _Iterator::reference reference;
192#if __cplusplus > 201703L
194 template<
typename _Tp>
195#if __cpp_concepts >= 201907L
196 requires is_object_v<_Tp>
202 using value_type = remove_cv_t<_Tp>;
203 using difference_type = ptrdiff_t;
204 using pointer = _Tp*;
205 using reference = _Tp&;
209 template<
typename _Tp>
213 typedef _Tp value_type;
214 typedef ptrdiff_t difference_type;
215 typedef _Tp* pointer;
216 typedef _Tp& reference;
220 template<
typename _Tp>
221 struct iterator_traits<const _Tp*>
223 typedef random_access_iterator_tag iterator_category;
224 typedef _Tp value_type;
225 typedef ptrdiff_t difference_type;
226 typedef const _Tp* pointer;
227 typedef const _Tp& reference;
235 template<
typename _Iter>
236 __attribute__((__always_inline__))
237 inline _GLIBCXX_CONSTEXPR
238 typename iterator_traits<_Iter>::iterator_category
244#if __cplusplus >= 201103L
245 template<
typename _Iter>
246 using __iter_category_t
247 =
typename iterator_traits<_Iter>::iterator_category;
249 template<
typename _InIter>
250 using _RequireInputIter =
251 __enable_if_t<is_convertible<__iter_category_t<_InIter>,
252 input_iterator_tag>::value>;
254 template<
typename _It,
255 typename _Cat = __iter_category_t<_It>>
256 struct __is_random_access_iter
257 : is_base_of<random_access_iterator_tag, _Cat>
259 typedef is_base_of<random_access_iterator_tag, _Cat> _Base;
260 enum { __value = _Base::value };
263 template<
typename _It,
typename _Traits = iterator_traits<_It>,
264 typename _Cat =
typename _Traits::iterator_category>
265 struct __is_random_access_iter
266 {
enum { __value = __is_base_of(random_access_iterator_tag, _Cat) }; };
269_GLIBCXX_END_NAMESPACE_VERSION
constexpr iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
ISO C++ entities toplevel namespace is std.
Traits class for iterators.
Marking output iterators.
Forward iterators support a superset of input iterator operations.
Bidirectional iterators support a superset of forward iterator operations.
Random-access iterators support a superset of bidirectional iterator operations.
Contiguous iterators point to objects stored contiguously in memory.
_Category iterator_category
One of the tag types.
_Pointer pointer
This type represents a pointer-to-value_type.
_Distance difference_type
Distance between iterators is represented as this type.
_Reference reference
This type represents a reference-to-value_type.
_Tp value_type
The type "pointed to" by the iterator.