---
name: "__gnu_pbds::detail::thin_heap"
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_pbds::detail::thin_heap"
---

# \_\_gnu\_pbds::detail::thin\_heap(3)

## NAME

\_\_gnu\_pbds::detail::thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \>

## SYNOPSIS

\#include \<thin\_heap\_.hpp\>

Inherits **\_\_gnu\_pbds::detail::left\_child\_next\_sibling\_heap\< Value\_Type, Cmp\_Fn, \_Alloc::size\_type, \_Alloc \>**.

### Public Types

typedef \_Alloc **allocator\_type**\
 typedef Cmp\_Fn **cmp\_fn**\
 typedef base\_type::const\_iterator **const\_iterator**\
 typedef \_\_rebind\_a::const\_pointer **const\_pointer**\
 typedef \_\_rebind\_a::const\_reference **const\_reference**\
 typedef \_Alloc::difference\_type **difference\_type**\
 typedef base\_type::iterator **iterator**\
 typedef base\_type::point\_const\_iterator **point\_const\_iterator**\
 typedef base\_type::point\_iterator **point\_iterator**\
 typedef \_\_rebind\_a::pointer **pointer**\
 typedef \_\_rebind\_a::reference **reference**\
 typedef \_Alloc::size\_type **size\_type**\
 typedef Value\_Type **value\_type**\

### Public Member Functions

iterator **begin** ()\
 void **clear** ()\
 bool **empty** () const\
 iterator **end** ()\
 void **erase** (point\_iterator)\
 template\<typename Pred\> size\_type **erase\_if** (Pred)\
 Cmp\_Fn & **get\_cmp\_fn** ()\
 void **join** (thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \> &)\
 size\_type **max\_size** () const\
 void **modify** (point\_iterator, const\_reference)\
 void **pop** ()\
 point\_iterator **push** (const\_reference)\
 size\_type **size** () const\
 template\<typename Pred\> void **split** (Pred, thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \> &)\
 void **swap** (left\_child\_next\_sibling\_heap\< Value\_Type, Cmp\_Fn, \_Alloc::size\_type, \_Alloc \> &)\
 const\_reference **top** () const\

### Protected Types

typedef base\_type::node **node**\
 typedef alloc\_traits::allocator\_type **node\_allocator**\
 typedef base\_type::node\_const\_pointer **node\_const\_pointer**\
 typedef \_Alloc::size\_type **node\_metadata**\
 typedef base\_type::node\_pointer **node\_pointer**\
 typedef **std::pair**\< node\_pointer, node\_pointer \> **node\_pointer\_pair**\

### Protected Member Functions

**thin\_heap** (const Cmp\_Fn &)\
 **thin\_heap** (const thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \> &)\
 void **actual\_erase\_node** (node\_pointer)\
 void **bubble\_to\_top** (node\_pointer)\
 void **clear\_imp** (node\_pointer)\
 template\<typename It\> void **copy\_from\_range** (It, It)\
 node\_pointer **get\_new\_node\_for\_insert** (const\_reference)\
 node\_pointer **prune** (Pred)\
 void **swap** (thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \> &)\
 void **swap\_with\_parent** (node\_pointer, node\_pointer)\
 void **to\_linked\_list** ()\
 void **value\_swap** (left\_child\_next\_sibling\_heap &)\

### Static Protected Member Functions

static node\_pointer **parent** (node\_pointer)\

### Protected Attributes

node\_pointer **m\_p\_root**\
 size\_type **m\_size**\

## Detailed Description

### template\<typename Value\_Type, typename Cmp\_Fn, typename \_Alloc\>

class \_\_gnu\_pbds::detail::thin\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \>"Thin heap.

See Tarjan and Kaplan.

## Author

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