__GNU_CXX::THROW_ALLOCATOR_RANDOM(3)

πŸ’– __gnu_cxx::throw_allocator_random< _Tp > πŸ’–

okay bestie, sit down, hydrate, because we're about to get into a libstdc++ manual page and honestly? it's giving niche-but-iconic. this one lives in the Library Functions Manual under the <pink>libstdc++</pink> banner, and the whole page is literally just __gnu_cxx:...dom< _Tp >(3) energy. yes, the title got truncated. no, we don't talk about it. πŸŽ€


✨ NAME ✨

__gnu_cxx::throw_allocator_random< _Tp > β€” Allocator throwing via random condition. 🎲πŸ’₯


🌸 SYNOPSIS 🌸

#include <throw_allocator.h>

Inherits __gnu_cxx::throw_allocator_base< _Tp, random_condition >. 🫢

πŸ‘‘ Public Types

  • typedef const value_type * const_pointer β€” a pointer that refuses to let you touch the goods. read-only vibes.
  • typedef const value_type & const_reference β€” same energy but a reference. no edits allowed, bestie.
  • typedef std::ptrdiff_t difference_type β€” the difference between two pointers, standard issue.
  • typedef value_type * pointer β€” the regular, fully-writable pointer type.
  • typedef std::true_type propagate_on_container_move_assignment β€” yes, this container does carry its allocator along when move-assigned. std::true_type. it said "I'm coming with you" and meant it. πŸ’…
  • typedef value_type & reference β€” a normal reference.
  • typedef std::size_t size_type β€” sizes are std::size_t. periodt.
  • typedef _Tp value_type β€” the type you're storing. the main character, lowkey.

πŸ’… Public Member Functions

  • throw_allocator_random (const throw_allocator_random &) noexcept β€” copy constructor. noexcept, so it's not gonna surprise you. ✨
  • template<typename _Tp1> throw_allocator_random (const throw_allocator_random< _Tp1 > &) noexcept β€” the templated converting copy constructor. yes it's a whole mouthful, yes it's noexcept. 😌
  • pointer address (reference __x) const noexcept β€” hands you the actual address of __x. noexcept. no drama.
  • pointer allocate (size_type __n, const void *__hint=0) β€” grab memory for __n things. there's an optional __hint pointer that defaults to 0.
  • void check (size_type __n) β€” the member check. πŸ‘€
  • void check_allocated (pointer __p, size_type __n) β€” verify that __p really is allocated for __n.
  • map_alloc_type::iterator check_allocated (void *p, size_t size) β€” the overload taking a void *p and a size_t size, handing back a map_alloc_type::iterator.
  • void check_constructed (size_t label) β€” checks construction, by label.
  • map_construct_type::iterator check_constructed (void *p) β€” the void *p overload, returning a map_construct_type::iterator.
  • void construct (_Up *__p, _Args &&... __args) β€” construct a _Up at __p from __args. the classic variadic glow-up. 🌈
  • void deallocate (pointer __p, size_type __n) β€” give the memory back. bye babe, thanks for the memories. πŸ¦‹
  • void destroy (_Up *__p) β€” tear down the object at __p.
  • void erase (void *p, size_t size) β€” erase the (p, size) entry.
  • void erase_construct (void *p) β€” erase the construction record at p.
  • void insert (void *p, size_t size) β€” insert a (p, size) record.
  • void insert_construct (void *p) β€” record a construction at p.
  • size_type max_size () const noexcept β€” biggest size it'll handle. const and noexcept, obviously. πŸ‘‘
  • throw_allocator_random & operator= (const throw_allocator_random &)=default β€” assignment operator, defaulted. it's not doing anything extra, and that's on purpose.
  • void seed (unsigned long __s) β€” seed the randomness with __s. this is the one that decides whether today is a throw day. 🎲

πŸŽ€ Static Public Member Functions

  • static void check () β€” the no-argument static check. there are two checks on this page, keep up bestie. πŸ™ˆ
  • static size_t get_label () β€” returns the current label as a size_t.
  • static void set_label (size_t l) β€” set the label to l.
  • static void set_probability (double __p) β€” set the throw probability to __p. this is the dial that controls the chaos. πŸ”₯
  • static void throw_conditionally () β€” throw, conditionally. that's it. that's the function. it's giving "maybe". πŸ’€

🧚 Detailed Description 🧚

template<typename _Tp>
    struct __gnu_cxx::throw_allocator_random< _Tp >

"Allocator throwing via random condition." 🌈✨

like, that's the whole description. an allocator that throws, and whether it throws is up to a random condition. chaotic? yes. iconic? also yes. no cap. πŸ’–

ngl, that's all the detail the original page gives you on the description front. no extra lore, no secret tips, just the vibe. don't let anyone tell you otherwise. 😭

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code. so if you're mad about the formatting, take it up with Doxygen, not me. 🫢


okay that's the whole page!! πŸ’– this was the <hotpink>libstdc++</hotpink> manual page for __gnu_cxx:...dom< _Tp >(3) β€” yes the title is still truncated, and yes we're all going to be normal about it. thanks for reading, bestie, go forth and seed responsibly. πŸŽ€πŸ¦‹βœ¨

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