30 #ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC
31 #define _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 1
35 template<
typename _Iterator,
typename _Sequence>
37 _Safe_iterator<_Iterator, _Sequence>::
38 _M_can_advance(
const difference_type& __n)
const
40 typedef typename _Sequence::const_iterator const_debug_iterator;
41 typedef typename const_debug_iterator::iterator_type const_iterator;
43 if (this->_M_singular())
49 const_iterator __begin = _M_get_sequence()->_M_base().begin();
51 this->_M_get_distance(__begin, base());
52 bool __ok = ((__dist.
second == __dp_exact && __dist.
first >= -__n)
53 || (__dist.
second != __dp_exact && __dist.
first > 0));
58 const_iterator __end = _M_get_sequence()->_M_base().end();
60 this->_M_get_distance(base(), __end);
61 bool __ok = ((__dist.
second == __dp_exact && __dist.
first >= __n)
62 || (__dist.
second != __dp_exact && __dist.
first > 0));
67 template<
typename _Iterator,
typename _Sequence>
68 template<
typename _Other>
70 _Safe_iterator<_Iterator, _Sequence>::
71 _M_valid_range(
const _Safe_iterator<_Other, _Sequence>& __rhs)
const
73 if (!_M_can_compare(__rhs))
79 this->_M_get_distance(base(), __rhs.base());
82 if (__dist.
first == 0)
88 return __dist.
first >= 0;
95 if (_M_is_begin() || __rhs._M_is_end())
97 if (_M_is_end() || __rhs._M_is_begin())
Struct holding two objects of arbitrary type.
_T1 first
second_type is the second bound type
_T2 second
first is a copy of the first object