__GNU_DEBUG::_SAFE_SEQUENCE(3)

πŸ’– NAME πŸ’–

__gnu_debug::_Safe_sequence< _Sequence > β€” bestie, this is the base class for constructing a safe sequence type that tracks iterators that reference it. periodt. ✨

(Oh and real quick β€” this page lives in the Library Functions Manual, section 3. iykyk 🫢)


🌸 SYNOPSIS 🌸

#include <safe_sequence.h>
  • Inherits __gnu_debug::_Safe_sequence_base. yes, it's a nepo baby, it inherited everything πŸ’…
  • Inherited by __gnu_debug::_Safe_container< deque, _Allocator, __gnu_debug::_Safe_sequence >, __gnu_debug::_Safe_container< basic_string, _Allocator, _Safe_sequence, bool(1)>, __gnu_debug::_Safe_container< vector, _Allocator, __gnu_debug::_Safe_sequence >, and __gnu_debug::_Safe_node_sequence< _Sequence >. the whole friend group fr fr πŸŽ€

✨ Public Member Functions ✨

  • template<typename _Predicate> constexpr void _M_invalidate_if (_Predicate __pred) const
  • template<typename _Predicate> void _M_transfer_from_if (const _Safe_sequence &__from, _Predicate __pred) const

πŸ¦‹ Public Attributes πŸ¦‹

  • _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.
  • unsigned int _M_version β€” The container version number. This number may never be 0. not even once. 🚫

πŸ’œ Protected Member Functions πŸ’œ

  • 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

🌈 Detailed Description 🌈

template<typename _Sequence>
    class __gnu_debug::_Safe_sequence< _Sequence >

Base class for constructing a safe sequence type that tracks iterators that reference it. 🫢

okay so the tea is this: the class template _Safe_sequence simplifies the construction of safe sequences that track the iterators that reference the sequence, so that those iterators get notified of changes in the sequence that may affect their operation β€” e.g., if the container invalidates its iterators or is destructed. no cap, it's giving extremely attentive bestie energy. πŸ’…

the way this works: 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. (iconic name, iconic behaviour ✨)

and the derived class must have iterator and const_iterator types that are instantiations of class template _Safe_iterator for this sequence. do that, and the iterators will then be tracked automatically. slay, no manual labour required. 🧚


πŸ‘‘ Member Function Documentation πŸ‘‘

void __gnu_debug::_Safe_sequence_base::_M_detach_all () const [protected], [inherited]

Detach all iterators, leaving them singular. bye besties, you're on your own now 😭

Referenced by ~_Safe_sequence_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. consistency queen πŸ‘‘

__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 single one. the whole roster. πŸ’€

References _M_invalidate_all(), and _M_version.

Referenced by _M_invalidate_all().

template<typename _Sequence> template<typename _Predicate> void __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if (_Predicate __pred) const [inline], [constexpr]

Invalidates all iterators x that reference this sequence, are not singular, and for which __pred(x) returns true. __pred will be invoked with the normal iterators nested in the safe ones. so it's a vibe check, but for iterators πŸ”₯

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). it's giving second-chance romance πŸ₯Ή

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. full custody swap, no drama πŸ’…

template<typename _Sequence> template<typename _Predicate> void __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if (const _Safe_sequence< _Sequence > & __from, _Predicate __pred) const

Transfers all iterators x that reference from sequence, are not singular, and for which __pred(x) returns true. __pred will be invoked with the normal iterators nested in the safe ones.

References std::__addressof(), __gnu_debug::_Safe_sequence_base::_M_const_iterators, __gnu_debug::_Safe_sequence_base::_M_get_mutex(), __gnu_debug::_Safe_sequence_base::_M_iterators, __gnu_debug::_Safe_iterator_base::_M_next, __gnu_debug::_Safe_iterator_base::_M_prior, __gnu_debug::_Safe_iterator_base::_M_sequence, __gnu_debug::_Safe_iterator_base::_M_version, and __gnu_debug::_Safe_sequence_base::_M_version.


πŸ“ 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_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().

unsigned int __gnu_debug::_Safe_sequence_base::_M_version [mutable], [inherited]

The container version number. This number may never be 0. genuinely never. zero is not invited to this party πŸ™ˆ

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. no human wrote this, it just manifested ✨


🫢 ok that's the whole page bestie, every single flag, member, mutex and version number accounted for, nothing skipped, nothing invented. ate and left no crumbs. πŸ’…

made with love for libstdc++, page __gnu_debug::_Safe_sequence< _Sequence >(3) from the Library Functions Manual β€” mwah, go track some iterators πŸŽ€

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