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

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

## NAME

\_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_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\_Hash\_Fn **comb\_hash\_fn**\
 typedef **cc\_hash\_tag** **container\_category**\
 typedef Eq\_Fn **eq\_fn**\
 typedef Hash\_Fn **hash\_fn**\
 typedef Resize\_Policy **resize\_policy**\

### Public Member Functions

**cc\_hash\_table** ()\
 Default constructor.  **cc\_hash\_table** (const cc\_hash\_table &other)\
 **cc\_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.  **cc\_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.  **cc\_hash\_table** (const hash\_fn &h, const eq\_fn &e, const comb\_hash\_fn &ch)\
 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\_hash\_fn will be copied by the comb\_hash\_fn object of the container object.  **cc\_hash\_table** (const hash\_fn &h, const eq\_fn &e, const comb\_hash\_fn &ch, 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\_hash\_fn will be copied by the comb\_hash\_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\> **cc\_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\> **cc\_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.  template\<typename It\> **cc\_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\> **cc\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e, const comb\_hash\_fn &ch)\
 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\_hash\_fn will be copied by the comb\_hash\_fn object of the container object.  template\<typename It\> **cc\_hash\_table** (It first, It last, const hash\_fn &h, const eq\_fn &e, const comb\_hash\_fn &ch, 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\_hash\_fn will be copied by the comb\_hash\_fn object of the container object, and r\_resize\_policy will be copied by the resize\_policy object of the container object.  **cc\_hash\_table** & **operator=** (const **cc\_hash\_table** &other)\
 void **swap** (**cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\>

class \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>"A collision-chaining hash-based associative container.

**Template Parameters**

*Key* Key type. \
 *Mapped* Map type. \
 *Hash\_Fn* Hashing functor. \
 *Eq\_Fn* Equal functor. \
 *Comb\_Hash\_Fn* Combining hash functor. If Hash\_Fn is not null\_type, then this is the ranged-hash functor; otherwise, this is the range-hashing functor. XXX(See Design::Hash-Based Containers::Hash Policies.) \
 *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: cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_hash\_table (const hash\_fn & h, const eq\_fn & e, const comb\_hash\_fn & ch) \[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\_hash\_fn will be copied by the comb\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_hash\_table (const hash\_fn & h, const eq\_fn & e, const comb\_hash\_fn & ch, 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\_hash\_fn will be copied by the comb\_hash\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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.

### 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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e, const comb\_hash\_fn & ch) \[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\_hash\_fn will be copied by the comb\_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\_Hash\_Fn = detail::default\_comb\_hash\_fn::type, typename Resize\_Policy = typename detail::default\_resize\_policy\<Comb\_Hash\_Fn\>::type, bool Store\_Hash = detail::default\_store\_hash, typename \_Alloc = std::allocator\<char\>\> template\<typename It\> \_\_gnu\_pbds::cc\_hash\_table\< Key, Mapped, Hash\_Fn, Eq\_Fn, Comb\_Hash\_Fn, Resize\_Policy, Store\_Hash, \_Alloc \>::cc\_hash\_table (It first, It last, const hash\_fn & h, const eq\_fn & e, const comb\_hash\_fn & ch, 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\_hash\_fn will be copied by the comb\_hash\_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.
