29 #ifndef _GLIBCXX_DEBUG_FUNCTIONS_H
30 #define _GLIBCXX_DEBUG_FUNCTIONS_H 1
32 #include <bits/c++config.h>
40 template<
typename _Iterator,
typename _Sequence>
49 template<
typename _Iterator>
55 template<
typename _Tp>
58 {
return __ptr == 0; }
61 template<
typename _Iterator,
typename _Sequence>
68 template<
typename _Iterator>
74 template<
typename _Tp>
80 template<
typename _Iterator,
typename _Sequence>
88 template<
typename _RandomAccessIterator>
91 const _RandomAccessIterator& __last,
92 std::random_access_iterator_tag)
93 {
return __last - __first >= 0; }
99 template<
typename _InputIterator>
102 std::input_iterator_tag)
109 template<
typename _Integral>
117 template<
typename _InputIterator>
120 const _InputIterator& __last, std::__false_type)
122 std::__iterator_category(__first)); }
129 template<
typename _InputIterator>
133 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
138 template<
typename _Iterator,
typename _Sequence>
145 template<
typename _Iterator,
typename _Sequence>
155 template<
typename _InputIterator>
156 inline _InputIterator
158 const _InputIterator& __last
166 template<
typename _CharT,
typename _Integer>
171 #ifdef _GLIBCXX_DEBUG_PEDANTIC
172 __glibcxx_assert(__s != 0 || __n == 0);
178 template<
typename _CharT>
182 #ifdef _GLIBCXX_DEBUG_PEDANTIC
183 __glibcxx_assert(__s != 0);
190 template<
typename _InputIterator>
193 std::input_iterator_tag)
198 template<
typename _ForwardIterator>
201 std::forward_iterator_tag)
203 if (__first == __last)
206 _ForwardIterator __next = __first;
207 for (++__next; __next != __last; __first = __next, ++__next)
208 if (*__next < *__first)
216 template<
typename _Iterator,
typename _Sequence>
220 std::random_access_iterator_tag __tag)
225 template<
typename _InputIterator,
typename _Predicate>
228 _Predicate, std::input_iterator_tag)
233 template<
typename _ForwardIterator,
typename _Predicate>
236 _Predicate __pred, std::forward_iterator_tag)
238 if (__first == __last)
241 _ForwardIterator __next = __first;
242 for (++__next; __next != __last; __first = __next, ++__next)
243 if (__pred(*__next, *__first))
251 template<
typename _Iterator,
typename _Sequence,
257 std::random_access_iterator_tag __tag)
261 template<
typename _InputIterator>
267 __glibcxx_assert(__first == __last || !(*__first < *__first));
270 std::__iterator_category(__first));
273 template<
typename _InputIterator,
typename _Predicate>
280 __glibcxx_assert(__first == __last || !__pred(*__first, *__first));
283 std::__iterator_category(__first));
286 template<
typename _InputIterator>
289 const _InputIterator& __last,
293 template<
typename _InputIterator>
296 const _InputIterator&,
300 template<
typename _InputIterator,
typename _Predicate>
303 const _InputIterator& __last,
304 _Predicate __pred, std::__true_type)
307 template<
typename _InputIterator,
typename _Predicate>
310 const _InputIterator&, _Predicate,
315 template<
typename _InputIterator1,
typename _InputIterator2>
318 const _InputIterator1& __last,
319 const _InputIterator2&)
321 typedef typename std::iterator_traits<_InputIterator1>::value_type
323 typedef typename std::iterator_traits<_InputIterator2>::value_type
326 typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
331 template<
typename _InputIterator1,
typename _InputIterator2,
335 const _InputIterator1& __last,
336 const _InputIterator2&, _Predicate __pred)
338 typedef typename std::iterator_traits<_InputIterator1>::value_type
340 typedef typename std::iterator_traits<_InputIterator2>::value_type
343 typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
351 template<
typename _ForwardIterator,
typename _Tp>
354 _ForwardIterator __last,
const _Tp& __value)
356 while (__first != __last && *__first < __value)
358 if (__first != __last)
361 while (__first != __last && !(*__first < __value))
364 return __first == __last;
367 template<
typename _ForwardIterator,
typename _Tp>
370 _ForwardIterator __last,
const _Tp& __value)
372 while (__first != __last && !(__value < *__first))
374 if (__first != __last)
377 while (__first != __last && __value < *__first)
380 return __first == __last;
384 template<
typename _ForwardIterator,
typename _Tp,
typename _Pred>
387 _ForwardIterator __last,
const _Tp& __value,
390 while (__first != __last &&
bool(__pred(*__first, __value)))
392 if (__first != __last)
395 while (__first != __last && !
bool(__pred(*__first, __value)))
398 return __first == __last;
401 template<
typename _ForwardIterator,
typename _Tp,
typename _Pred>
404 _ForwardIterator __last,
const _Tp& __value,
407 while (__first != __last && !
bool(__pred(__value, *__first)))
409 if (__first != __last)
412 while (__first != __last &&
bool(__pred(__value, *__first)))
415 return __first == __last;
419 template<
typename _Iterator>
426 template<
typename _Iterator,
typename _Sequence>
428 : std::__are_same<std::random_access_iterator_tag,
429 typename std::iterator_traits<_Iterator>::
433 template<
typename _Iterator>
435 : std::_Iter_base<_Iterator, __is_safe_random_iterator<_Iterator>::__value>
444 template<
typename _Iterator>
bool __check_singular(_Iterator &)
Definition: functions.h:51
bool __check_sorted(const _InputIterator &__first, const _InputIterator &__last)
Definition: functions.h:263
bool __valid_range_aux(const _Integral &, const _Integral &, std::__true_type)
Definition: functions.h:111
bool __check_sorted_aux(const _InputIterator &, const _InputIterator &, std::input_iterator_tag)
Definition: functions.h:192
const _CharT * __check_string(const _CharT *__s, const _Integer &__n __attribute__((__unused__)))
Definition: functions.h:168
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Definition: functions.h:446
bool __check_dereferenceable(_Iterator &)
Definition: functions.h:70
bool __check_partitioned_upper(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:369
double __v4df __attribute__((__vector_size__(32)))
Definition: avxintrin.h:32
Definition: functions.h:422
bool __check_partitioned_lower(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:353
bool __valid_range_aux2(const _RandomAccessIterator &__first, const _RandomAccessIterator &__last, std::random_access_iterator_tag)
Definition: functions.h:90
bool _M_dereferenceable() const
Is the iterator dereferenceable?
Definition: safe_iterator.h:420
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
_InputIterator __check_valid_range(const _InputIterator &__first, const _InputIterator &__last __attribute__((__unused__)))
Definition: functions.h:157
bool __valid_range(const _InputIterator &__first, const _InputIterator &__last)
Definition: functions.h:131
bool __check_sorted_set_aux(const _InputIterator &__first, const _InputIterator &__last, std::__true_type)
Definition: functions.h:288
_GLIBCXX_PURE bool _M_singular() const
Definition: functions.h:434
bool _M_valid_range(const _Safe_iterator< _Other, _Sequence > &__rhs) const
Definition: safe_iterator.tcc:70
bool __check_singular_aux(const void *)
Definition: functions.h:45
std::__false_type __type
Definition: functions.h:423
bool __check_sorted_set(const _InputIterator1 &__first, const _InputIterator1 &__last, const _InputIterator2 &)
Definition: functions.h:317
Safe iterator wrapper.
Definition: formatter.h:46
bool _M_valid_range(const _Safe_local_iterator< _Other, _Sequence > &__rhs) const
Definition: safe_local_iterator.tcc:38
Safe iterator wrapper.
Definition: formatter.h:49
Definition: functions.h:420
_Iterator base() const
Return the underlying iterator.
Definition: safe_iterator.h:396