__GNU_DEBUG::_SAFE_FORWARD_LIST(3)

✨ NAME ✨

__gnu_debug::_Safe_forward_list< _SafeSequence > β€” bestie, it's giving special iterators, swap, and invalidation for forward_list πŸ’… and the whole reason it needs its own little class is the before_begin iterator. iykyk πŸ¦‹

This page lives in the Library Functions Manual section, and it's part of libstdc++. 🫢


🌸 SYNOPSIS 🌸

#include <forward_list>

Inherits __gnu_debug::_Safe_sequence< _SafeSequence >.

Inherited by __gnu_debug::_Safe_container< forward_list, _Alloc, __gnu_debug::_Safe_forward_list >.

πŸ‘‘ Public Member Functions

  • constexpr void _M_invalidate_if (_Predicate __pred) const β€” the invalidator, but make it constexpr ✨
  • void _M_transfer_from_if (const _Safe_sequence &__from, _Predicate __pred) const β€” transfers the iterators that match, no cap πŸ’–

πŸŽ€ 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 πŸ’€ fr fr.

πŸ¦‹ Protected Member Functions

  • void _M_detach_all () const
  • void _M_detach_singular () const
  • __gnu_cxx::__mutex & _M_get_mutex () const noexcept
  • void _M_invalidate_all () const
  • void _M_revalidate_singular () const
  • void _M_swap (const _Safe_forward_list &) const noexcept
  • void _M_swap (const _Safe_sequence_base &__x) const noexcept

🌈 Detailed Description 🌈

template<typename _SafeSequence>
class __gnu_debug::_Safe_forward_list< _SafeSequence >

okay so the vibe here is: special iterators swap and invalidation for forward_list β€” and it's all because of that before_begin iterator. that's the whole plot bestie, no notes πŸ’…βœ¨


πŸ’– Member Function Documentation πŸ’–

  • void __gnu_debug::_Safe_sequence_base::_M_detach_all () const [protected], [inherited] β€” detaches all the iterators, which leaves them singular. they're on their own now, main character energy but alone 😭
  • void __gnu_debug::_Safe_sequence_base::_M_detach_singular () const [protected], [inherited] β€” detaches all the 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. that's it, that's the description, it's giving mysterious 🧚
  • void __gnu_debug::_Safe_sequence< _SafeSequence >::_M_invalidate_if (_Predicate __pred) const [inline], [constexpr], [inherited] β€” invalidates every iterator x that references this sequence, is not singular, and for which __pred(x) returns true. and heads up: __pred gets invoked with the normal iterators nested in the safe ones. πŸ’…
  • void __gnu_debug::_Safe_sequence_base::_M_revalidate_singular () const [protected], [inherited] β€” revalidates all attached singular iterators. this one's the glow-up method: it can be used to validate iterators that were invalidated before but, for some reason (like an exception 🫠), need to become valid again. slay, redemption arc πŸ’–
  • void __gnu_debug::_Safe_sequence_base::_M_swap (const _Safe_sequence_base & __x) const [protected], [noexcept], [inherited] β€” swaps this sequence with the given sequence. and not just the sequences, bestie β€” this operation also swaps ownership of the iterators, so when it's done, all iterators that originally referenced one container now reference the other container. full identity swap, no cap πŸ‘‘
  • void __gnu_debug::_Safe_sequence< _SafeSequence >::_M_transfer_from_if (const _Safe_sequence< _SafeSequence > & __from, _Predicate __pred) const [inherited] β€” transfers every iterator x that references the __from sequence, is not singular, and for which __pred(x) returns true. same deal as before: __pred gets invoked with the normal iterators nested in the safe ones.
    • References: _M_iterators.

πŸ“ 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. πŸ’œ
  • _Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_iterators [mutable], [inherited] β€” the list of mutable iterators that reference this container.
    • Referenced by: _M_transfer_from_if(). πŸ”—
  • unsigned int __gnu_debug::_Safe_sequence_base::_M_version [mutable], [inherited] β€” the container version number. and again for the people in the back: this number may never be 0 πŸ’€

🫢 Author 🫢

Generated automatically by Doxygen for libstdc++ from the source code. not a human author, just the robot doing its thing πŸ€–βœ¨


and that's the whole page bestie!! πŸŒˆπŸ’– this little slice of the libstdc++ manual came straight from the libstdc++ source, page name __gnu_debu...Sequence >(3) (the long name got trimmed in the header, tragic but iconic πŸ™ˆ), and it's the Library Functions Manual edition. go forth and swap your iterators responsibly, ily πŸŽ€πŸ¦‹πŸ‘‘

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