29 #ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 30 #define _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 1 34 template<
typename _Iterator,
typename _Sequence>
36 _Safe_iterator<_Iterator, _Sequence>::
37 _M_can_advance(
const difference_type& __n)
const 39 if (this->_M_singular())
48 __get_distance_from_begin(*
this);
49 bool __ok = ((__dist.
second == __dp_exact && __dist.
first >= -__n)
50 || (__dist.
second != __dp_exact && __dist.
first > 0));
56 __get_distance_to_end(*
this);
57 bool __ok = ((__dist.
second == __dp_exact && __dist.
first >= __n)
58 || (__dist.
second != __dp_exact && __dist.
first > 0));
63 template<
typename _Iterator,
typename _Sequence>
65 _Safe_iterator<_Iterator, _Sequence>::
66 _M_valid_range(
const _Safe_iterator& __rhs,
70 if (!_M_can_compare(__rhs))
78 if (__dist.
first == 0)
86 return !__check_dereferenceable || _M_dereferenceable();
87 return __dist.
first == 0;
_T2 second
first is a copy of the first object
_Distance_traits< _Iterator >::__type __get_distance(const _Iterator &__lhs, const _Iterator &__rhs, std::random_access_iterator_tag)
_T1 first
second_type is the second bound type
bool __check_dereferenceable(const _Iterator &)
Struct holding two objects of arbitrary type.
GNU debug classes for public use.