__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 arestd::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'snoexcept. π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__nthings. there's an optional__hintpointer that defaults to0.void check (size_type __n)β the membercheck. πvoid check_allocated (pointer __p, size_type __n)β verify that__preally is allocated for__n.map_alloc_type::iterator check_allocated (void *p, size_t size)β the overload taking avoid *pand asize_t size, handing back amap_alloc_type::iterator.void check_constructed (size_t label)β checks construction, bylabel.map_construct_type::iterator check_constructed (void *p)β thevoid *poverload, returning amap_construct_type::iterator.void construct (_Up *__p, _Args &&... __args)β construct a_Upat__pfrom__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 atp.void insert (void *p, size_t size)β insert a(p, size)record.void insert_construct (void *p)β record a construction atp.size_type max_size () const noexceptβ biggest size it'll handle.constandnoexcept, 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 staticcheck. there are twochecks on this page, keep up bestie. πstatic size_t get_label ()β returns the current label as asize_t.static void set_label (size_t l)β set the label tol.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