libstdc++
|
Inherited by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::random_access_iterator_tag >.
Public Types | |
typedef _Safe_iterator< _Iterator, _Sequence, iterator_category > | _Self |
typedef _Traits::difference_type | difference_type |
typedef _Traits::iterator_category | iterator_category |
typedef _Iterator | iterator_type |
typedef _Traits::pointer | pointer |
typedef _Traits::reference | reference |
typedef _Traits::value_type | value_type |
Public Member Functions | |
_Safe_iterator () noexcept | |
_Safe_iterator (_Iterator __i, const _Safe_sequence_base *__seq) noexcept | |
_Safe_iterator (_Safe_iterator &&__x) noexcept | |
_Safe_iterator (const _Safe_iterator &__x) noexcept | |
template<typename _MutableIterator > | |
_Safe_iterator (const _Safe_iterator< _MutableIterator, _Sequence, typename __gnu_cxx::__enable_if< _IsConstant::__value &&std::__are_same< _MutableIterator, _OtherIterator >::__value, _Category >::__type > &__x) noexcept | |
void | _M_attach (_Safe_sequence_base *__seq) |
void | _M_attach_single (_Safe_sequence_base *__seq) |
bool | _M_before_dereferenceable () const |
bool | _M_can_advance (difference_type __n, bool __strict=false) const |
bool | _M_dereferenceable () const |
_Distance_traits< _Iterator >::__type | _M_get_distance_from_begin () const |
_Distance_traits< _Iterator >::__type | _M_get_distance_to (const _Safe_iterator &__rhs) const |
_Distance_traits< _Iterator >::__type | _M_get_distance_to_end () const |
__gnu_cxx::__conditional_type< _IsConstant::__value, const _Sequence *, _Sequence * >::__type | _M_get_sequence () const |
bool | _M_incrementable () const |
bool | _M_is_before_begin () const |
bool | _M_is_begin () const |
bool | _M_is_beginnest () const |
bool | _M_is_end () const |
bool | _M_valid_range (const _Safe_iterator &__rhs, std::pair< difference_type, _Distance_precision > &__dist, bool __check_dereferenceable=true) const |
const _Iterator & | base () const noexcept |
_Iterator & | base () noexcept |
operator _Iterator () const noexcept | |
reference | operator* () const noexcept |
_Safe_iterator & | operator++ () noexcept |
_Safe_iterator | operator++ (int) noexcept |
pointer | operator-> () const noexcept |
_Safe_iterator & | operator= (_Safe_iterator &&__x) noexcept |
_Safe_iterator & | operator= (const _Safe_iterator &__x) noexcept |
Static Public Member Functions | |
static constexpr bool | _S_constant () |
Protected Member Functions | |
_Safe_iterator (_Iterator __i, _Safe_sequence_base *__seq, _Attach_single) noexcept | |
Friends | |
template<typename _IteR > | |
bool | operator!= (const _Self &__lhs, const _Safe_iterator< _IteR, _Sequence, iterator_category > &__rhs) noexcept |
bool | operator!= (const _Self &__lhs, const _Self &__rhs) noexcept |
template<typename _IteR > | |
bool | operator== (const _Self &__lhs, const _Safe_iterator< _IteR, _Sequence, iterator_category > &__rhs) noexcept |
bool | operator== (const _Self &__lhs, const _Self &__rhs) noexcept |
Safe iterator wrapper.
The class template _Safe_iterator is a wrapper around an iterator that tracks the iterator's movement among sequences and checks that operations performed on the "safe" iterator are legal. In additional to the basic iterator operations (which are validated, and then passed to the underlying iterator), _Safe_iterator has member functions for iterator invalidation, attaching/detaching the iterator from sequences, and querying the iterator's state.
Note that _Iterator must be the first base class so that it gets initialized before the iterator is being attached to the container's list of iterators and it is being detached before _Iterator get destroyed. Otherwise it would result in a data race.
|
inlinenoexcept |
Definition at line 148 of file safe_iterator.h.
|
inlinenoexcept |
Safe iterator construction from an unsafe iterator and its sequence.
seq
is not NULL Definition at line 157 of file safe_iterator.h.
|
inlinenoexcept |
Copy construction.
Definition at line 169 of file safe_iterator.h.
|
inlinenoexcept |
Move construction.
Definition at line 187 of file safe_iterator.h.
|
inlinenoexcept |
Converting constructor from a mutable iterator to a constant iterator.
Definition at line 207 of file safe_iterator.h.
|
inline |
Attach iterator to the given sequence.
Definition at line 371 of file safe_iterator.h.
|
inline |
Likewise, but not thread-safe.
Definition at line 376 of file safe_iterator.h.
|
inline |
Is the iterator before a dereferenceable one?
Definition at line 386 of file safe_iterator.h.
|
inline |
Is the iterator dereferenceable?
Definition at line 381 of file safe_iterator.h.
|
inline |
Is the iterator incrementable?
Definition at line 398 of file safe_iterator.h.
Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_before_dereferenceable().
|
inline |
Is this iterator equal to the sequence's before_begin() iterator if any?
Definition at line 442 of file safe_iterator.h.
Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_dereferenceable().
|
inline |
Is this iterator equal to the sequence's begin() iterator?
Definition at line 431 of file safe_iterator.h.
|
inline |
Is this iterator equal to the sequence's before_begin() iterator if any or begin() otherwise?
Definition at line 448 of file safe_iterator.h.
|
inline |
Is this iterator equal to the sequence's end() iterator?
Definition at line 436 of file safe_iterator.h.
Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_dereferenceable(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_incrementable().
|
inlinestaticconstexpr |
Determine if this is a constant iterator.
Definition at line 351 of file safe_iterator.h.
Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_attach(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_attach_single().
|
inlinenoexcept |
Return the underlying iterator.
Definition at line 358 of file safe_iterator.h.
Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_before_dereferenceable(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_is_begin(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >::_M_is_end().
|
inlinenoexcept |
Conversion to underlying non-debug iterator to allow better interaction with non-debug containers.
Definition at line 367 of file safe_iterator.h.
|
inlinenoexcept |
Iterator dereference.
Definition at line 296 of file safe_iterator.h.
|
inlinenoexcept |
Iterator preincrement.
Definition at line 323 of file safe_iterator.h.
|
inlinenoexcept |
Iterator postincrement.
Definition at line 338 of file safe_iterator.h.
|
inlinenoexcept |
Iterator dereference.
Definition at line 309 of file safe_iterator.h.
|
inlinenoexcept |
Move assignment.
Definition at line 261 of file safe_iterator.h.
|
inlinenoexcept |
Copy assignment.
Definition at line 229 of file safe_iterator.h.