---
name: "__gnu_pbds::detail::binary_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::binary_heap"
---

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

## NAME

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

## SYNOPSIS

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

Inherits .

### Public Types

typedef \_Alloc **allocator\_type**\
 typedef Cmp\_Fn **cmp\_fn**\
 typedef **cond\_dealtor**\< value\_type, \_Alloc \> **cond\_dealtor\_t**\
 typedef **binary\_heap\_const\_iterator\_**\< value\_type, entry, simple\_value, \_Alloc \> **const\_iterator**\
 typedef \_\_rebind\_v::const\_pointer **const\_pointer**\
 typedef \_\_rebind\_v::const\_reference **const\_reference**\
 typedef \_Alloc::difference\_type **difference\_type**\
 typedef \_\_conditional\_type\< simple\_value, value\_type, pointer \>::\_\_type **entry**\
 typedef **rebind\_traits**\< \_Alloc, entry \>::allocator\_type **entry\_allocator**\
 typedef entry\_cmp\< Value\_Type, Cmp\_Fn, \_Alloc, is\_simple\< Value\_Type \>::value \>**::type** **entry\_cmp**\
 typedef **rebind\_traits**\< \_Alloc, entry \>::pointer **entry\_pointer**\
 typedef const\_iterator **iterator**\
 typedef **binary\_heap\_point\_const\_iterator\_**\< value\_type, entry, simple\_value, \_Alloc \> **point\_const\_iterator**\
 typedef point\_const\_iterator **point\_iterator**\
 typedef \_\_rebind\_v::pointer **pointer**\
 typedef \_\_rebind\_v::reference **reference**\
 typedef **\_\_gnu\_pbds::detail::resize\_policy**\< typename \_Alloc::size\_type \> **resize\_policy**\
 typedef \_Alloc::size\_type **size\_type**\
 typedef Value\_Type **value\_type**\

### Public Member Functions

**binary\_heap** (const binary\_heap &)\
 **binary\_heap** (const cmp\_fn &)\
 iterator **begin** ()\
 const\_iterator **begin** () const\
 void **clear** ()\
 bool **empty** () const\
 iterator **end** ()\
 const\_iterator **end** () const\
 void **erase** (point\_iterator)\
 void **erase\_at** (entry\_pointer, size\_type, false\_type)\
 void **erase\_at** (entry\_pointer, size\_type, true\_type)\
 template\<typename Pred\> size\_type **erase\_if** (Pred)\
 Cmp\_Fn & **get\_cmp\_fn** ()\
 const Cmp\_Fn & **get\_cmp\_fn** () const\
 size\_type **get\_new\_size\_for\_arbitrary** (size\_type) const\
 size\_type **get\_new\_size\_for\_grow** () const\
 size\_type **get\_new\_size\_for\_shrink** () const\
 bool **grow\_needed** (size\_type) const\
 void **join** (binary\_heap &)\
 size\_type **max\_size** () const\
 void **modify** (point\_iterator, const\_reference)\
 void **notify\_arbitrary** (size\_type)\
 void **notify\_grow\_resize** ()\
 void **notify\_shrink\_resize** ()\
 void **pop** ()\
 point\_iterator **push** (const\_reference)\
 bool **resize\_needed\_for\_grow** (size\_type) const\
 bool **resize\_needed\_for\_shrink** (size\_type) const\
 bool **shrink\_needed** (size\_type) const\
 size\_type **size** () const\
 template\<typename Pred\> void **split** (Pred, binary\_heap &)\
 void **swap** (binary\_heap &)\
 void **swap** (resize\_policy\< \_Alloc::size\_type \> &)\
 const\_reference **top** () const\

### Static Public Attributes

static const \_Alloc::size\_type **min\_size**\

### Protected Member Functions

template\<typename It\> void **copy\_from\_range** (It, It)\

## Detailed Description

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

class \_\_gnu\_pbds::detail::binary\_heap\< Value\_Type, Cmp\_Fn, \_Alloc \>"Binary heaps composed of resize and compare policies.

Based on CLRS.

## Author

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