---
name: "__gnu_pbds::detail::pairing_heap"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_pbds::detail::pairing_heap/3cxx"
---

# \_\_gnu\_pbds::detail::pairing\_heap(3cxx)

## NAME

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

## SYNOPSIS

`#include <pairing_heap_.hpp>`

Inherits **\_\_gnu\_pbds::detail::left\_child\_next\_sibling\_heap\< Value\_Type, Cmp\_Fn, null\_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 **left\_child\_next\_sibling\_heap\_node\_**\< Value\_Type, **null\_type**, \_Alloc \> **node**\
 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

**pairing\_heap** (const Cmp\_Fn &)\
 **pairing\_heap** (const **pairing\_heap** &)\
 **iterator** **begin** ()\
 **const\_iterator** **begin** () const\
 void **clear** ()\
 bool **empty** () const\
 **iterator** **end** ()\
 **const\_iterator** **end** () const\
 void **erase** (**point\_iterator**)\
 template\<typename Pred \> size\_type **erase\_if** (Pred)\
 Cmp\_Fn & **get\_cmp\_fn** ()\
 const Cmp\_Fn & **get\_cmp\_fn** () const\
 void **join** (**pairing\_heap** &)\
 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, **pairing\_heap** &)\
 void **swap** (**left\_child\_next\_sibling\_heap**\< Value\_Type, Cmp\_Fn, **null\_type**, \_Alloc \> &)\
 void **swap** (**pairing\_heap** &)\
 const\_reference **top** () const\

### Protected Types

typedef alloc\_traits::allocator\_type **node\_allocator**\
 typedef alloc\_traits::const\_pointer **node\_const\_pointer**\
 typedef **null\_type** **node\_metadata**\
 typedef **std::pair**\< node\_pointer, node\_pointer \> **node\_pointer\_pair**\

### Protected Member Functions

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\_with\_parent** (node\_pointer, node\_pointer)\
 void **to\_linked\_list** ()\
 void **value\_swap** (**left\_child\_next\_sibling\_heap** &)\

### Static Protected Member Functions

static void **make\_child\_of** (node\_pointer, node\_pointer)\
 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::pairing\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \>"Pairing heap.

## Author

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