__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 () constvoid _M_detach_singular () const__gnu_cxx::__mutex & _M_get_mutex () const noexceptvoid _M_invalidate_all () constvoid _M_revalidate_singular () constvoid _M_swap (const _Safe_forward_list &) const noexceptvoid _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
iattached to this sequence,i->_M_version == _M_version. β
- Postcondition: for all iterators
__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 iteratorxthat references this sequence, is not singular, and for which__pred(x)returnstrue. and heads up:__predgets 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 iteratorxthat references the__fromsequence, is not singular, and for which__pred(x)returnstrue. same deal as before:__predgets invoked with the normal iterators nested in the safe ones.- References:
_M_iterators.
- References:
π 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(). π
- Referenced by:
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