__GNU_DEBUG::_SAFE_UNORDERED_CONTAINER(3)
Hey bestie! Welcome to the Library Functions Manual page for __gnu_debug::_Safe_unordered_container< _Container >(3). This is the safe unordered container base class, and she is iconic. Let's get into it. π
β¨ NAME β¨
__gnu_debug::_Safe_unordered_container< _Container > β Base class for constructing a safe unordered container type that tracks iterators that reference it.
π¦ SYNOPSIS π¦
#include <safe_unordered_container.h>
Inherits __gnu_debug::_Safe_unordered_container_base.
Inherited by these absolute legends:
__gnu_debug::_Safe_container< unordered_map, _Alloc, __gnu_debug::_Safe_unordered_container >__gnu_debug::_Safe_container< unordered_multimap, _Alloc, __gnu_debug::_Safe_unordered_container >__gnu_debug::_Safe_container< unordered_set, _Alloc, __gnu_debug::_Safe_unordered_container >__gnu_debug::_Safe_container< unordered_multiset, _Alloc, __gnu_debug::_Safe_unordered_container >
πΈ Public Attributes πΈ
_Safe_iterator_base * _M_const_iteratorsβ The list of constant iterators that reference this container._Safe_iterator_base * _M_const_local_iteratorsβ The list of constant local iterators that reference this container._Safe_iterator_base * _M_iteratorsβ The list of mutable iterators that reference this container._Safe_iterator_base * _M_local_iteratorsβ The list of mutable local iterators that reference this container.unsigned int _M_versionβ The container version number. This number may never be 0.
π Protected Member Functions π
void _M_detach_all () constvoid _M_detach_singular () const__gnu_cxx::__mutex & _M_get_mutex () const noexcepttemplate<typename _VictimIt> void _M_invalidate (_VictimIt __victim)template<typename _VictimIt> void _M_invalidate (_VictimIt __victim, const __gnu_cxx::__scoped_lock &__lock)constexpr void _M_invalidate_all () constvoid _M_invalidate_all ()template<typename _Predicate> void _M_invalidate_all_if (_Predicate __pred)void _M_revalidate_singular () constvoid _M_swap (const _Safe_sequence_base &__x) const noexceptvoid _M_swap (const _Safe_unordered_container_base &__x) const noexcept
π Detailed Description π
template<typename _Container> class __gnu_debug::_Safe_unordered_container< _Container > β Base class for constructing a safe unordered container type that tracks iterators that reference it.
Okay so the class template _Safe_unordered_container makes building safe unordered containers so much easier. It keeps tabs on the iterators that reference the container, so those iterators get notified whenever the container changes in a way that could affect their operation β for example, if the container invalidates its iterators or gets destructed. Obsessed with the safety.
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 const_iterator types that are instantiations of class template _Safe_iterator for this container, and local_iterator and const_local_iterator types that are instantiations of class template _Safe_local_iterator for this container. After that? Iterators get tracked automatically. Periodt. β¨
π§ Member Function Documentation π§
void __gnu_debug::_Safe_unordered_container_base::_M_detach_all () const
[protected], [inherited]
Detach all iterators, leaving them singular.
Referenced by ~_Safe_unordered_container_base().
void __gnu_debug::_Safe_sequence_base::_M_detach_singular () const
[protected], [inherited]
Detach all singular iterators.
Postcondition: for all iterators i attached to this sequence, i->_M_version == _M_version.
__gnu_cxx::__mutex & __gnu_debug::_Safe_sequence_base::_M_get_mutex () const
[protected], [noexcept], [inherited]
For use in _Safe_sequence.
Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if().
void __gnu_debug::_Safe_sequence_base::_M_invalidate_all () const
[inline], [constexpr], [protected], [inherited]
Invalidates all iterators.
References _M_invalidate_all(), and _M_version.
Referenced by _M_invalidate_all().
void __gnu_debug::_Safe_sequence_base::_M_revalidate_singular () const
[protected], [inherited]
Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reason, such as an exception, need to become valid again).
void __gnu_debug::_Safe_sequence_base::_M_swap (const _Safe_sequence_base & __x) const
[protected], [noexcept], [inherited]
Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.
void __gnu_debug::_Safe_unordered_container_base::_M_swap (const _Safe_unordered_container_base & __x) const
[protected], [noexcept], [inherited]
Swap this container with the given container. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.
π Member Data Documentation π
_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_const_iterators
[mutable], [inherited]
The list of constant iterators that reference this container.
Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if().
_Safe_iterator_base* __gnu_debug::_Safe_unordered_container_base::_M_const_local_iterators
[mutable], [inherited]
The list of constant local iterators that reference this container.
_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_iterators
[mutable], [inherited]
The list of mutable iterators that reference this container.
Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if().
_Safe_iterator_base* __gnu_debug::_Safe_unordered_container_base::_M_local_iterators
[mutable], [inherited]
The list of mutable local iterators that reference this container.
unsigned int __gnu_debug::_Safe_sequence_base::_M_version
[mutable], [inherited]
The container version number. This number may never be 0.
Referenced by _M_invalidate_all(), __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if(), __gnu_debug::_Safe_iterator< _Base_iterator, map >::operator=(), __gnu_debug::_Safe_iterator< _Base_iterator, map >::operator=(), __gnu_debug::_Safe_local_iterator< _OtherIterator, _UContainer >::operator=(), and __gnu_debug::_Safe_local_iterator< _OtherIterator, _UContainer >::operator=().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
Okay bestie, that's the whole page! Signed off by libstdc++ and titled __gnu_debug::_Safe_unordered_container< _Container >(3). No date on this footer, just pure libstdc++ energy. Stay safe, stay tracked! π
π¦
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms