---
name: "__gnu_cxx::throw_allocator_random"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::throw_allocator_random"
---

# \_\_gnu\_cxx::throw\_allocator\_random(3)

Allocator throwing via random condition.

## 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**\
 typedef const value\_type & **const\_reference**\
 typedef std::ptrdiff\_t **difference\_type**\
 typedef value\_type \* **pointer**\
 typedef **std::true\_type** **propagate\_on\_container\_move\_assignment**\
 typedef value\_type & **reference**\
 typedef std::size\_t **size\_type**\
 typedef \_Tp **value\_type**\

### Public Member Functions

**throw\_allocator\_random** (const throw\_allocator\_random &) noexcept\
 template\<typename \_Tp1\> **throw\_allocator\_random** (const throw\_allocator\_random\< \_Tp1 \> &) noexcept\
 pointer **address** (reference \_\_x) const noexcept\
 pointer **allocate** (size\_type \_\_n, const void \*\_\_hint=0)\
 void **check** (size\_type \_\_n)\
 void **check\_allocated** (pointer \_\_p, size\_type \_\_n)\
 map\_alloc\_type::iterator **check\_allocated** (void \*p, size\_t size)\
 void **check\_constructed** (size\_t label)\
 map\_construct\_type::iterator **check\_constructed** (void \*p)\
 void **construct** (\_Up \*\_\_p, \_Args &&... \_\_args)\
 void **deallocate** (pointer \_\_p, size\_type \_\_n)\
 void **destroy** (\_Up \*\_\_p)\
 void **erase** (void \*p, size\_t size)\
 void **erase\_construct** (void \*p)\
 void **insert** (void \*p, size\_t size)\
 void **insert\_construct** (void \*p)\
 size\_type **max\_size** () const noexcept\
 throw\_allocator\_random & **operator=** (const throw\_allocator\_random &)=default\
 void **seed** (unsigned long \_\_s)\

### Static Public Member Functions

static void **check** ()\
 static size\_t **get\_label** ()\
 static void **set\_label** (size\_t l)\
 static void **set\_probability** (double \_\_p)\
 static void **throw\_conditionally** ()\

## Detailed Description

### template\<typename \_Tp\>

struct \_\_gnu\_cxx::throw\_allocator\_random\< \_Tp \>"Allocator throwing via random condition.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
