---
name: "__gnu_pbds::gp_hash_table"
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::gp_hash_table"
---

# \_\_gnu\_pbds::gp\_hash\_table(3)

## NAME

\_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>

## SYNOPSIS

\#include \<assoc\_container.hpp\>

Inherits **\_\_gnu\_pbds::basic\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Resize\_Policy, Store\_Hash, Tag, Policy\_Tl, \_Alloc \>**.

### Public Types

typedef Comb\_Probe\_Fn **comb\_probe\_fn**\
 typedef **gp\_hash\_tag** **container\_category**\
 typedef Eq\_Fn **eq\_fn**\
 typedef Hash\_Fn **hash\_fn**\
 typedef Probe\_Fn **probe\_fn**\
 typedef Resize\_Policy **resize\_policy**\

### Public Member Functions

**gp\_hash\_table** ()\
 Default constructor.  **gp\_hash\_table** (const gp\_hash\_table &other)\
 **gp\_hash\_table** (const hash\_fn &h)\
 Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object.  **gp\_hash\_table** (const hash\_fn &h, const eq\_fn &e)\
 Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, and r\_eq\_fn will be copied by the eq\_fn object of the container object.  **gp\_hash\_table** (const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp)\
 Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, and r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object.  **gp\_hash\_table** (const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp, const probe\_fn &p)\
 Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, and r\_probe\_fn will be copied by the probe\_fn object of the container object.  **gp\_hash\_table** (const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp, const probe\_fn &p, const resize\_policy &rp)\
 Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, r\_probe\_fn will be copied by the probe\_fn object of the container object, and r\_resize\_policy will be copied by the Resize\_Policy object of the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last)\
 Constructor taking \_\_iterators to a range of value\_types. The value\_types between first\_it and last\_it will be inserted into the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last, const hash\_fn &h)\
 Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e)\
 Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, and r\_eq\_fn will be copied by the eq\_fn object of the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp)\
 Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, and r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp, const probe\_fn &p)\
 Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, and r\_probe\_fn will be copied by the probe\_fn object of the container object.  template\<typename It\> **gp\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e, const comb\_probe\_fn &cp, const probe\_fn &p, const resize\_policy &rp)\
 Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, r\_probe\_fn will be copied by the probe\_fn object of the container object, and r\_resize\_policy will be copied by the resize\_policy object of the container object.  **gp\_hash\_table** & **operator=** (const **gp\_hash\_table** &other)\
 void **swap** (**gp\_hash\_table** &other)\

## Detailed Description

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\>

class \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>"A general-probing hash-based associative container.

**Template Parameters**

*Key* Key type. \
 *Mapped* Map type. \
 *Hash\_Fn* Hashing functor. \
 *Eq\_Fn* Equal functor. \
 *Comb\_Probe\_Fn* Combining probe functor. If Hash\_Fn is not null\_type, then this is the ranged-probe functor; otherwise, this is the range-hashing functor. XXX See Design::Hash-Based Containers::Hash Policies. \
 *Probe\_Fn* Probe functor. \
 *Resize\_Policy* Resizes hash. \
 *Store\_Hash* Indicates whether the hash value will be stored along with each key. If Hash\_Fn is null\_type, then the container will not compile if this value is true \
 *\_Alloc* Allocator type.

Base tag choices are: gp\_hash\_tag.

Base is basic\_hash\_table.

## Constructor & Destructor Documentation

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table () \[inline\]

Default constructor.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (const hash\_fn & h) \[inline\]

Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (const hash\_fn & h, const eq\_fn & e) \[inline\]

Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, and r\_eq\_fn will be copied by the eq\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp) \[inline\]

Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, and r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp, const probe\_fn & p) \[inline\]

Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, and r\_probe\_fn will be copied by the probe\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp, const probe\_fn & p, const resize\_policy & rp) \[inline\]

Constructor taking some policy objects. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, r\_probe\_fn will be copied by the probe\_fn object of the container object, and r\_resize\_policy will be copied by the Resize\_Policy object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last) \[inline\]

Constructor taking \_\_iterators to a range of value\_types. The value\_types between first\_it and last\_it will be inserted into the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last, const hash\_fn & h) \[inline\]

Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e) \[inline\]

Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, and r\_eq\_fn will be copied by the eq\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp) \[inline\]

Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, and r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp, const probe\_fn & p) \[inline\]

Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, and r\_probe\_fn will be copied by the probe\_fn object of the container object.

### template\<typename Key, typename Mapped, typename Hash\_Fn = typename detail::default\_hash\_fn\<Key\>::type, typename Eq\_Fn = typename detail::default\_eq\_fn\<Key\>::type, typename Comb\_Probe\_Fn = detail::default\_comb\_hash\_fn::type, typename Probe\_Fn = typename detail::default\_probe\_fn\<Comb\_Probe\_Fn\>::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Probe\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::gp\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Probe\_Fn, Probe\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::gp\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e, const comb\_probe\_fn & cp, const probe\_fn & p, const resize\_policy & rp) \[inline\]

Constructor taking \_\_iterators to a range of value\_types and some policy objects. The value\_types between first\_it and last\_it will be inserted into the container object. r\_hash\_fn will be copied by the hash\_fn object of the container object, r\_eq\_fn will be copied by the eq\_fn object of the container object, r\_comb\_probe\_fn will be copied by the comb\_probe\_fn object of the container object, r\_probe\_fn will be copied by the probe\_fn object of the container object, and r\_resize\_policy will be copied by the resize\_policy object of the container object.

## Author

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