#include <safe_sequence.h>
Inheritance diagram for __gnu_debug::_Safe_sequence< _Sequence >:
Public Member Functions | |
template<typename _Predicate> | |
void | _M_invalidate_if (_Predicate __pred) |
template<typename _Iterator> | |
void | _M_transfer_iter (const _Safe_iterator< _Iterator, _Sequence > &__x) |
The class template _Safe_sequence simplifies the construction of "safe" sequences that track the iterators that reference the sequence, so that the iterators are notified of changes in the sequence that may affect their operation, e.g., if the container invalidates its iterators or is destructed. This class template may only be used by deriving from it and passing the name of the derived class as its template parameter via the curiously recurring template pattern. The derived class must have iterator
and types that are instantiations of class template _Safe_iterator for this sequence. Iterators will then be tracked automatically.
Definition at line 98 of file safe_sequence.h.
void __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if | ( | _Predicate | __pred | ) |
Invalidates all iterators x
that reference this sequence, are not singular, and for which pred(x)
returns true
. The user of this routine should be careful not to make copies of the iterators passed to pred
, as the copies may interfere with the invalidation.
Definition at line 122 of file safe_sequence.h.
References __gnu_debug::_Safe_sequence_base::_M_const_iterators, and __gnu_debug::_Safe_sequence_base::_M_iterators.
Referenced by __gnu_debug_def::set< _Key, _Compare, _Allocator >::_M_invalidate_all(), __gnu_debug_def::multiset< _Key, _Compare, _Allocator >::_M_invalidate_all(), __gnu_debug_def::multimap< _Key, _Tp, _Compare, _Allocator >::_M_invalidate_all(), __gnu_debug_def::map< _Key, _Tp, _Compare, _Allocator >::_M_invalidate_all(), __gnu_debug_def::list< _Tp, _Allocator >::_M_invalidate_all(), __gnu_debug_def::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::_M_invalidate_all(), __gnu_debug_def::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::_M_invalidate_all(), __gnu_debug_def::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::_M_invalidate_all(), __gnu_debug_def::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::_M_invalidate_all(), __gnu_debug_def::vector< _Tp, _Allocator >::erase(), __gnu_debug_def::vector< _Tp, _Allocator >::insert(), __gnu_debug_def::vector< _Tp, _Allocator >::resize(), and __gnu_debug_def::deque< _Tp, _Allocator >::resize().
void __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter | ( | const _Safe_iterator< _Iterator, _Sequence > & | __x | ) |
Transfers all iterators that reference this memory location to this sequence from whatever sequence they are attached to.
Definition at line 154 of file safe_sequence.h.
References __gnu_debug::_Safe_sequence_base::_M_const_iterators, __gnu_debug::_Safe_sequence_base::_M_iterators, __gnu_debug::_Safe_iterator_base::_M_sequence, and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::base().
Referenced by __gnu_debug_def::list< _Tp, _Allocator >::splice().