__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 > โ 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_fntypedef cc_hash_tag container_categorytypedef Eq_Fn eq_fntypedef Hash_Fn hash_fntypedef 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_fnwill be copied by theHash_Fnobject of the container object. ๐cc_hash_table (const hash_fn &h, const eq_fn &e)โ Constructor taking some policy objects.r_hash_fnwill be copied by thehash_fnobject of the container object, andr_eq_fnwill be copied by theeq_fnobject 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_fnwill be copied by thehash_fnobject of the container object,r_eq_fnwill be copied by theeq_fnobject of the container object, andr_comb_hash_fnwill be copied by thecomb_hash_fnobject 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_fnwill be copied by thehash_fnobject of the container object,r_eq_fnwill be copied by theeq_fnobject of the container object,r_comb_hash_fnwill be copied by thecomb_hash_fnobject of the container object, andr_resize_policywill be copied by theresize_policyobject of the container object. ๐template<typename It> cc_hash_table (It first, It last)โ Constructor taking__iteratorsto a range ofvalue_types. Thevalue_typesbetweenfirst_itandlast_itwill be inserted into the container object. ๐ฆtemplate<typename It> cc_hash_table (It first, It last, const hash_fn &h)โ Constructor taking__iteratorsto a range ofvalue_typesand some policy objects. Thevalue_typesbetweenfirst_itandlast_itwill 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__iteratorsto a range ofvalue_typesand some policy objects. Thevalue_typesbetweenfirst_itandlast_itwill be inserted into the container object.r_hash_fnwill be copied by thehash_fnobject of the container object, andr_eq_fnwill be copied by theeq_fnobject 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__iteratorsto a range ofvalue_typesand some policy objects. Thevalue_typesbetweenfirst_itandlast_itwill be inserted into the container object.r_hash_fnwill be copied by thehash_fnobject of the container object,r_eq_fnwill be copied by theeq_fnobject of the container object, andr_comb_hash_fnwill be copied by thecomb_hash_fnobject 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__iteratorsto a range ofvalue_typesand some policy objects. Thevalue_typesbetweenfirst_itandlast_itwill be inserted into the container object.r_hash_fnwill be copied by thehash_fnobject of the container object,r_eq_fnwill be copied by theeq_fnobject of the container object,r_comb_hash_fnwill be copied by thecomb_hash_fnobject of the container object, andr_resize_policywill be copied by theresize_policyobject of the container object. ๐ฅcc_hash_table & operator= (const cc_hash_table &other)โ Assignment operator. ๐void swap (cc_hash_table &other)โ Swaps withother. ๐ซถ
๐ 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. IfHash_Fnis notnull_type, then this is the ranged-hash functor; otherwise, this is the range-hashing functor.XXX(SeeDesign::Hash-Based Containers::Hash Policies.) ๐คResize_Policyโ Resizes hash. ๐Store_Hashโ Indicates whether the hash value will be stored along with each key. IfHash_Fnisnull_type, then the container will not compile if this value istrue๐_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