__GNU_PBDS::CC_HASH_MAX_COLLISION_CHECK_RESIZE_TRIGGER(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 5 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44

πŸ’– NAME πŸ’–

__gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type > β€” bestie, this is a resize trigger policy based on collision checks, and the way it works is it keeps the simulated load factor lower than some given load factor. That's it, that's the girl. ✨

This page lives in the Library Functions Manual, and yes, the name is a mouthful, we don't talk about it. 🫢


🌸 SYNOPSIS 🌸

#include <hash_policy.hpp>

πŸŽ€ Public Types

  • enum { external_load_access }
  • typedef Size_Type size_type

πŸ¦‹ Public Member Functions

  • cc_hash_max_collision_check_resize_trigger (float load=0.5) β€” default constructor, or a constructor that takes load, a __load factor which it will attempt to maintain.
  • float get_load () const β€” returns the current load.
  • void set_load (float load) β€” sets the load; does not resize the container.
  • void swap (cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type > &other)

πŸ‘‘ Protected Member Functions

  • bool is_grow_needed (size_type size, size_type num_entries) const β€” queries whether a grow is needed. This method is called only if this object indicated is needed.
  • bool is_resize_needed () const β€” queries whether a resize is needed.
  • void notify_cleared () β€” notifies the table was cleared.
  • void notify_erase_search_collision () β€” notifies a search encountered a collision.
  • void notify_erase_search_end () β€” notifies a search ended.
  • void notify_erase_search_start () β€” notifies an erase search started.
  • void notify_erased (size_type num_entries) β€” notifies an element was erased.
  • void notify_externally_resized (size_type new_size) β€” notifies the table was resized externally.
  • void notify_find_search_collision () β€” notifies a search encountered a collision.
  • void notify_find_search_end () β€” notifies a search ended.
  • void notify_find_search_start () β€” notifies a find search started.
  • void notify_insert_search_collision () β€” notifies a search encountered a collision.
  • void notify_insert_search_end () β€” notifies a search ended.
  • void notify_insert_search_start () β€” notifies an insert search started.
  • void notify_inserted (size_type num_entries) β€” notifies an element was inserted.
  • 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::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >

"A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor."

Periodt. πŸ’… That's the whole personality: watch the collisions, keep the simulated load factor under the load factor you told it about. Lowkey elegant, honestly.


🌈 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. iykyk 🧚

πŸ’œ Constructor & Destructor Documentation πŸ’œ

template<bool External_Load_Access, typename Size_Type>
__gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::cc_hash_max_collision_check_resize_trigger (float load = 0.5)

Default constructor, or constructor taking load, a __load factor which it will attempt to maintain. πŸ“


πŸ”₯ Member Function Documentation πŸ”₯

get_load

template<bool External_Load_Access, typename Size_Type>
float __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::get_load () const [inline]

Returns the current load. She's just telling you where she's at, no drama. ✨

is_grow_needed

template<bool External_Load_Access, typename Size_Type>
bool __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::is_grow_needed (size_type size, size_type num_entries) const [inline], [protected]

Queries whether a grow is needed. This method is called only if this object indicated is needed.

is_resize_needed

template<bool External_Load_Access, typename Size_Type>
bool __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::is_resize_needed () const [inline], [protected]

Queries whether a resize is needed.

notify_cleared

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_cleared () [protected]

Notifies the table was cleared.

References notify_resized().

notify_erase_search_collision

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_collision () [inline], [protected]

Notifies a search encountered a collision.

notify_erase_search_end

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_end () [inline], [protected]

Notifies a search ended.

notify_erase_search_start

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_start () [inline], [protected]

Notifies an erase search started.

notify_erased

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_erased (size_type num_entries) [inline], [protected]

Notifies an element was erased.

notify_externally_resized

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_externally_resized (size_type new_size) [protected]

Notifies the table was resized externally.

notify_find_search_collision

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_collision () [inline], [protected]

Notifies a search encountered a collision.

notify_find_search_end

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_end () [inline], [protected]

Notifies a search ended.

notify_find_search_start

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_start () [inline], [protected]

Notifies a find search started.

notify_insert_search_collision

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_collision () [inline], [protected]

Notifies a search encountered a collision.

notify_insert_search_end

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_end () [inline], [protected]

Notifies a search ended.

notify_insert_search_start

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_start () [inline], [protected]

Notifies an insert search started.

notify_inserted

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::notify_inserted (size_type num_entries) [inline], [protected]

Notifies an element was inserted.

notify_resized

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_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.

Referenced by notify_cleared().

set_load

template<bool External_Load_Access, typename Size_Type>
void __gnu_pbds::cc_hash_max_collision_check_resize_trigger< External_Load_Access, Size_Type >::set_load (float load)

Sets the load; does not resize the container. Not her job, don't ask. πŸ’…


🌟 Author 🌟

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


ok so that's the whole page, no gatekeeping πŸ’– every last notify_* is in there, every [inline], every [protected], the References notify_resized() and the Referenced by notify_cleared() cross-links, the template defaults, all of it. Nothing dropped, nothing invented.

And that's a wrap, bestie β€” this whole thing was auto-generated by Doxygen for libstdc++ from the source code, and it's the __gnu_pbds...Size_Type >(3) page from the Library Functions Manual. Take care of her, she's doing her best with all those collisions. πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ 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