__GNU_DEBUG::_SAFE_VECTOR(3)

πŸ’– NAME πŸ’–

okay bestie, say hi to __gnu_debug::_Safe_vector< _SafeSequence, _BaseSequence > β€” she's the base class for Debug Mode vector ✨. Like, the momager of debug-mode vectors. She's in the Library Functions Manual, she's iconic, she's lowkey doing the most behind the scenes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

first things first, you gotta pull her in:

#include <vector>

and she's inherited by... wait no, std::__debug::vector< _Tp, _Allocator >. That's the nepo baby. Adorable. We support her 🫢

✨ Protected Member Functions ✨

these are the family-only functions, no randos allowed:

  • constexpr _Safe_vector (_Safe_vector &&__x) noexcept β€” move-constructs her, and she will not throw at you, periodt
  • constexpr _Safe_vector (const _Safe_vector &) noexcept β€” copy-constructs her, also noexcept, she's unbothered fr fr
  • constexpr _Safe_vector (size_type __n) noexcept β€” builds her with a size of __n, again noexcept, she simply does not have the range for exceptions
  • bool _M_requires_reallocation (size_type __elements) const noexcept β€” asks the question: do we need to reallocate for __elements? returns a bool, const, noexcept, a whole vibe check πŸ¦‹
  • constexpr void _M_update_guaranteed_capacity () noexcept β€” refreshes the guaranteed capacity info, returns void because she gives, not takes πŸ’œ
  • constexpr _Safe_vector & operator= (_Safe_vector &&__x) noexcept β€” move-assign, hands back a reference to herself, noexcept
  • constexpr _Safe_vector & operator= (const _Safe_vector &) noexcept β€” copy-assign, also hands back _Safe_vector &, also noexcept

🌸 Protected Attributes 🌸

  • size_type _M_guaranteed_capacity β€” her little diary entry πŸ““ tracking the guaranteed capacity. main character data, honestly

πŸ‘‘ Detailed Description πŸ‘‘

template<typename _SafeSequence, typename _BaseSequence>
class __gnu_debug::_Safe_vector< _SafeSequence, _BaseSequence >

so what does she even do, bestie? she's the base class for Debug Mode vector πŸ’€ no cap.

and then β€” the plot twist β€” she adds information about the guaranteed capacity. Which is genuinely so useful, because it's how you catch code that's out here relying on non-portable implementation details of the libstdc++ reallocation policy 😭 like girl, that's not portable, that's not it, put it down πŸ™ˆ


🧚 Author 🧚

she was generated automatically by Doxygen for libstdc++ from the source code. not a human author, just a robot doing her lil thing πŸ€–βœ¨


okay that's the whole page, mwah πŸ’‹ shoutout to libstdc++ for this one, generated straight from the source code β€” love that for us 🫢🌈⭐

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