__GNU_PBDS::CC_HASH_TABLE(3)

๐Ÿ“ฆ
version 16.2.1+r23+gd564253eb6c8 ยท 6 versions
, in arch rolling, fedora 44

โœจ NAME โœจ

__gnu_pbds::cc_hash_table< Key, Mapped, Hash_Fn, Eq_Fn, Comb_Hash_Fn, Resize_Policy, Store_Hash, _Alloc > โ€” bestie, this is the Library Functions Manual page for this exact class. ๐Ÿ’– No cap, it's the collision-chaining hash-based associative container. ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

First thing, include this:

#include <assoc_container.hpp>

And it inherits from:

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. Periodt. โœจ
  • cc_hash_table (const cc_hash_table &other) โ€” Copy constructor. ๐Ÿซถ
  • 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) โ€” Assignment operator. ๐Ÿ’…
  • void swap (cc_hash_table &other) โ€” Swaps with other. ๐Ÿซถ

๐ŸŒˆ Detailed Description ๐ŸŒˆ

Okay so the full class declaration is giving:

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 >

And the description is exactly: 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 ๐ŸŽ€

okay bestie, this is the part where we find out how you actually make one of these bad boys ๐Ÿ’… every single constructor down here is inline, and they all carry the exact same big template head, which is literally this:

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 = typename 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>>

so whenever you see it repeated below, don't panic ๐Ÿซถ it's the same outfit, just shown again because that's how the docs do it. each one gives you a __gnu_pbds::cc_hash_table< Key, Mapped, Hash_Fn, Eq_Fn, Comb_Hash_Fn, Resize_Policy, Store_Hash, _Alloc > and a different lil' handful of stuff you can hand it.


๐Ÿ’– the default one โ€” cc_hash_table ()

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 = typename 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 โœจ no arguments, no drama, just a fresh empty container, periodt.


๐ŸŒธ the one that takes a hash fn โ€” cc_hash_table (const hash_fn & h)

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 = typename 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. (yes bestie, it's capital-H Hash_Fn right there in the original, we are not fixing it, that's canon ๐ŸŽ€)


๐Ÿฆ‹ the one with hash + eq โ€” cc_hash_table (const hash_fn & h, const eq_fn & e)

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 = typename 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. two policies, double the slay ๐Ÿ’…


๐ŸŒˆ hash + eq + comb โ€” cc_hash_table (const hash_fn & h, const eq_fn & e, const comb_hash_fn & ch)

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 = typename 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. we're stacking policies now and honestly? iconic ๐Ÿ”ฅ


โญ all four policies โ€” cc_hash_table (const hash_fn & h, const eq_fn & e, const comb_hash_fn & ch, const resize_policy & rp)

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 = typename 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. full set, full fit, no notes ๐Ÿ’–


๐ŸŽ€ the range one โ€” cc_hash_table (It first, It last)

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 = typename 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. yes bestie, drop a whole range in there and let it cook ๐Ÿ“


๐Ÿงš range + hash โ€” cc_hash_table (It first, It last, const hash_fn & h)

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 = typename 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. โœจ


๐Ÿ’œ range + hash + eq โ€” cc_hash_table (It first, It last, const hash_fn & h, const eq_fn & e)

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 = typename 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. ๐Ÿซถ


๐ŸŒธ range + hash + eq + comb โ€” cc_hash_table (It first, It last, const hash_fn & h, const eq_fn & e, const comb_hash_fn & ch)

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 = typename 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. ๐ŸŒˆ


๐Ÿ‘‘ the grand finale โ€” cc_hash_table (It first, It last, const hash_fn & h, const eq_fn & e, const comb_hash_fn & ch, const resize_policy & rp)

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 = typename 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. the whole buffet, every policy, one constructor, we ate ๐Ÿ’…๐Ÿ”ฅ


โœจ Author โœจ

Generated automatically by Doxygen for libstdc++ from the source code. like, nobody hand-wrote this bestie, the robot did it and honestly it devoured ๐Ÿค–๐Ÿ’–


that's a wrap on part two, babe ๐ŸŽ€ go build your container, use those policies, and remember: the vibes are immaculate and the template head is always the same. mwah ๐Ÿ’‹

this lil' page came to you courtesy of libstdc++, auto-generated by Doxygen straight from the source code, filed under __gnu_pbds...h, _Alloc >(3) โ€” see you in the next manpage, bestie ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 ยท GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms