__GNU_DEBUG::_SAFE_UNORDERED_CONTAINER_BASE(3)

✨ NAME ✨

__gnu_debug::_Safe_unordered_container_base β€” the base class that keeps track of local iterators pointing at an unordered container. πŸ’…

(oh and hey, this whole page lives in the Library Functions Manual, section 3, bestie 🫢)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <safe_unordered_base.h>

Inherits __gnu_debug::_Safe_sequence_base.

Inherited by:

__gnu_debug::_Safe_unordered_container< unordered_map< _Key, _Tp, std::hash< _Key >, std::equal_to< _Key >, std::allocator< std::pair< const _Key, _Tp > > > >,
__gnu_debug::_Safe_unordered_container< unordered_multimap< _Key, _Tp, std::hash< _Key >, std::equal_to< _Key >, std::allocator< std::pair< const _Key, _Tp > > > >,
__gnu_debug::_Safe_unordered_container< unordered_multiset< _Value, std::hash< _Value >, std::equal_to< _Value >, std::allocator< _Value > > >,
__gnu_debug::_Safe_unordered_container< unordered_set< _Value, std::hash< _Value >, std::equal_to< _Value >, std::allocator< _Value > > >,
and __gnu_debug::_Safe_unordered_container< _Container >.

🌸 Public Attributes 🌸

  • _Safe_iterator_base * _M_const_iterators β€” the linked list of constant iterators that reference this container.
  • _Safe_iterator_base * _M_const_local_iterators β€” the linked list of constant local iterators that reference this container.
  • _Safe_iterator_base * _M_iterators β€” the linked list of mutable iterators that reference this container.
  • _Safe_iterator_base * _M_local_iterators β€” the linked 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 πŸŽ€

  • _Safe_unordered_container_base (_Safe_unordered_container_base &&__x) β€” noexcept
  • _Safe_unordered_container_base (const _Safe_unordered_container_base &) β€” noexcept
  • ~_Safe_unordered_container_base () β€” noexcept
  • void _M_detach_all () const
  • void _M_detach_singular () const
  • __gnu_cxx::__mutex & _M_get_mutex () const noexcept
  • constexpr void _M_invalidate_all () const
  • void _M_revalidate_singular () const
  • void _M_swap (const _Safe_sequence_base &__x) const noexcept
  • void _M_swap (const _Safe_unordered_container_base &__x) const noexcept
  • _Safe_unordered_container_base & operator= (_Safe_unordered_container_base &&)=default
  • _Safe_unordered_container_base & operator= (_Safe_unordered_container_base const &)=default

🧚 Friends 🧚

  • class _Safe_local_iterator_base

πŸ’– Detailed Description πŸ’–

Base class that supports tracking of local iterators that reference an unordered container. 🫢

The _Safe_unordered_container_base class provides the basic support for tracking iterators into an unordered container. Containers that track iterators must derive from _Safe_unordered_container_base publicly, so that safe iterators (which inherit _Safe_iterator_base) can attach to them. No sneaky private inheritance, bestie, it's giving accessibility problems. 😭

This class contains four linked lists of iterators β€” one for constant iterators, one for mutable iterators, one for constant local iterators, one for mutable local iterators β€” plus a version number that allows very fast invalidation of all iterators that reference the container. Obsessed, honestly. ✨

This class must ensure that no operation on it may throw an exception, otherwise safe containers may fail to provide the exception-safety guarantees required by the C++ standard. No cap. πŸ”₯

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

__gnu_debug::_Safe_unordered_container_base::~_Safe_unordered_container_base () [inline], [protected], [noexcept]

Notify all iterators that reference this container that the container is being destroyed. πŸ’€ like a lil group chat "we're done here" message.

References _M_detach_all().


🌸 Member Function Documentation 🌸

void __gnu_debug::_Safe_unordered_container_base::_M_detach_all () const [protected]

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. every last one. πŸ’…

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). glow-up arc for iterators 🧚

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. it's giving Freaky Friday 😭

void __gnu_debug::_Safe_unordered_container_base::_M_swap (const _Safe_unordered_container_base & __x) const [protected], [noexcept]

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. same energy, unordered edition ✨


πŸ‘‘ 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]

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]

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. 🚨 fr fr, zero is not it.

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 that's the whole page bestie, no details left behind, ate and left no crumbs πŸ’…πŸŒˆ

This lil manual page came from the libstdc++ crew, lives in the Library Functions Manual, and was auto-generated by Doxygen straight from the source code β€” so if the vibes feel machine-made, that's because they literally are πŸ™ˆπŸ’– mwah, see u in the next header πŸŽ€

πŸ“¦ 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