__GNU_PBDS::HASH_LOAD_CHECK_RESIZE_TRIGGER(3)
π __gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type> π
okay bestie, welcome to the libstdc++ corner of the manual pages, this one lives in the Library Functions Manual and it's genuinely such a vibe. it's giving "policy class that keeps your hash table from spiraling". let's get into it π¦
β¨ NAME β¨
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type> β a resize trigger policy based on a load check. it keeps the load factor between some load factors load_min and load_max. that's the whole job. it does the job. slay.
πΈ SYNOPSIS πΈ
#include <hash_policy.hpp>
Inherits __gnu_pbds::detail::hash_load_check_resize_trigger_size_base<std::size_t, false>. yes she has a parent, we love a family tree π
Inherited by __gnu_pbds::hash_standard_resize_policy<Size_Policy, Trigger_Policy, External_Size_Access, Size_Type>. so other policies are literally built on top of her. main character energy fr fr π
π Public Types π
enum { external_load_access }β the anonymous enum, listed down in the member enumeration docs πtypedef Size_Type size_typeβ her lil size alias, iconic
π Public Member Functions π
hash_load_check_resize_trigger(float load_min = 0.125, float load_max = 0.5)β default constructor, or the constructor that takesload_minandload_maxload factors, between which this policy will keep the actual load.std::pair<float, float> get_loads() constβ returns a pair of the minimal and maximal loads, respectively. the receipts β¨void set_loads(std::pair<float, float> load_pair)β sets the loads through a pair of the minimal and maximal loads, respectively.void swap(hash_load_check_resize_trigger &other)β swaps withother. simple. cute. done.
π§ Protected Member Functions π§
bool is_grow_needed(size_type size, size_type num_entries) constbool is_resize_needed() constvoid notify_cleared()β notifies the table was cleared.void notify_erase_search_collision()void notify_erase_search_end()void notify_erase_search_start()void notify_erased(size_type num_entries)void notify_externally_resized(size_type new_size)void notify_find_search_collision()void notify_find_search_end()void notify_find_search_start()void notify_insert_search_collision()void notify_insert_search_end()void notify_insert_search_start()void notify_inserted(size_type num_entries)β notifies an element was inserted. the total number of entries in the table isnum_entries.void notify_resized(size_type new_size)β notifies the table was resized as a result of this object's signifying that a resize is needed.
π¦ Detailed Description π¦
template<bool External_Load_Access = false, typename Size_Type = std::size_t>
class __gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>
"A resize trigger policy based on a load check. It keeps the load factor between some load factors load_min and load_max." β that's her, that's the whole personality, and honestly? obsessed.
π Member Enumeration Documentation π
template<bool External_Load_Access = false, typename Size_Type = std::size_t>
anonymous enum
Enumerator
external_load_accessβ specifies whether the load factor can be accessed externally. the two options have different trade-offs in terms of flexibility, genericity, and encapsulation. so like, pick your fighter, both are valid π
β Constructor & Destructor Documentation β
template<bool External_Load_Access, typename Size_Type>
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
hash_load_check_resize_trigger(float load_min = 0.125, float load_max = 0.5)
default constructor, or constructor taking load_min and load_max load factors between which this policy will keep the actual load. the defaults are 0.125 and 0.5 and no cap, those are the real numbers π
π Member Function Documentation π
template<bool External_Load_Access, typename Size_Type>
std::pair<float, float>
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
get_loads() const [inline]
returns a pair of the minimal and maximal loads, respectively.
template<bool External_Load_Access, typename Size_Type>
void
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
notify_cleared() [protected]
notifies the table was cleared.
template<bool External_Load_Access, typename Size_Type>
void
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
notify_inserted(size_type num_entries) [inline], [protected]
notifies an element was inserted. the total number of entries in the table is num_entries.
template<bool External_Load_Access, typename Size_Type>
void
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
notify_resized(size_type new_size) [protected]
notifies the table was resized as a result of this object's signifying that a resize is needed.
- References
notify_resized(). - Referenced by
notify_resized().
bestie look β she references herself and gets referenced by herself. recursive queen behavior, we're not gonna question it, we're just gonna respect it πβ¨
template<bool External_Load_Access, typename Size_Type>
void
__gnu_pbds::hash_load_check_resize_trigger<External_Load_Access, Size_Type>::
set_loads(std::pair<float, float> load_pair)
sets the loads through a pair of the minimal and maximal loads, respectively.
π Author π
generated automatically by Doxygen for libstdc++ from the source code. the source code did the work, doxygen just wrote it down, and honestly? teamwork.
libstdc++ π __gnu_pbds...Size_Type >(3) β that's the source and the version tag bestie, and this whole page was a gift from the libstdc++ girlies. go resize something responsibly. periodt ππ
β¨
π¦ 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
- centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· 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
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· 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
- centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· 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 43: libstdc++-docs 15.2.1-2.fc43 Β· 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 43: libstdc++-docs 15.3.1-1.fc43 Β· 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.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