29 #ifndef _GLIBCXX_DEBUG_SAFE_SEQUENCE_TCC
30 #define _GLIBCXX_DEBUG_SAFE_SEQUENCE_TCC 1
34 template<
typename _Sequence>
35 template<
typename _Predicate>
40 typedef typename _Sequence::iterator iterator;
41 typedef typename _Sequence::const_iterator const_iterator;
46 iterator* __victim =
static_cast<iterator*
>(__iter);
47 __iter = __iter->_M_next;
48 if (!__victim->_M_singular() && __pred(__victim->base()))
50 __victim->_M_invalidate();
56 const_iterator* __victim =
static_cast<const_iterator*
>(__iter2);
57 __iter2 = __iter2->_M_next;
58 if (!__victim->_M_singular() && __pred(__victim->base()))
60 __victim->_M_invalidate();
65 template<
typename _Sequence>
66 template<
typename _Predicate>
74 typedef typename _Sequence::iterator iterator;
75 typedef typename _Sequence::const_iterator const_iterator;
88 iterator* __victim =
static_cast<iterator*
>(__victim_base);
90 if (!__victim->_M_singular() && __pred(__victim->base()))
93 if (__transfered_iterators)
95 __victim_base->
_M_next = __transfered_iterators;
96 __transfered_iterators->
_M_prior = __victim_base;
99 __last_iterator = __victim_base;
102 __transfered_iterators = __victim_base;
110 const_iterator* __victim =
111 static_cast<const_iterator*
>(__victim_base);
113 if (!__victim->_M_singular() && __pred(__victim->base()))
116 if (__transfered_const_iterators)
118 __victim_base->
_M_next = __transfered_const_iterators;
119 __transfered_const_iterators->
_M_prior = __victim_base;
122 __last_const_iterator = __victim;
125 __transfered_const_iterators = __victim_base;
131 if (__last_iterator || __last_const_iterator)
136 if (this->_M_iterators)
138 this->_M_iterators->_M_prior = __last_iterator;
139 __last_iterator->
_M_next = this->_M_iterators;
141 this->_M_iterators = __transfered_iterators;
143 if (__last_const_iterator)
145 if (this->_M_const_iterators)
147 this->_M_const_iterators->
_M_prior = __last_const_iterator;
148 __last_const_iterator->
_M_next = this->_M_const_iterators;
150 this->_M_const_iterators = __transfered_const_iterators;
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
GNU debug classes for public use.
Base class for constructing a safe sequence type that tracks iterators that reference it.
void _M_invalidate_if(_Predicate __pred)
void _M_transfer_from_if(_Safe_sequence &__from, _Predicate __pred)
Basic functionality for a safe iterator.
_Safe_sequence_base * _M_sequence
_Safe_iterator_base * _M_prior
_Safe_iterator_base * _M_next
_Safe_iterator_base * _M_const_iterators
The list of constant iterators that reference this container.
_Safe_iterator_base * _M_iterators
The list of mutable iterators that reference this container.
__gnu_cxx::__mutex & _M_get_mutex()