__GNU_PBDS::HASH_LOAD_CHECK_RESIZE_TRIGGER(3cxx)

πŸ’– NAME πŸ’–

okay so bestie, this page is the manual for __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type > β€” and the manual name on the header is __gnu_pbds::ha...ss, Size_Type >(3cxx) (yes, the terminal clipped it, it's giving "long title problems" 🫠).

It's 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 vibe β€” it watches the load and says "girl, we need to resize" when you cross the line. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <hash_policy.hpp>

Inherits __gnu_pbds::detail::hash_load_check_resize_trigger_size_base< Size_Type, Hold_Size >.

Inherited by __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >.

πŸ‘‘ Public Types

  • enum { external_load_access }
  • typedef Size_Type size_type

🌸 Public Member Functions

  • 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. slay, you get defaults and control πŸ’…
  • std::pair< float, float > get_loads () const β€” Returns a pair of the minimal and maximal loads, respectively.
  • 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 with other (no extra description in the source, she's mysterious like that πŸ™ˆ)

πŸŽ€ Protected Member Functions

  • bool is_grow_needed (size_type size, size_type num_entries) const
  • bool is_resize_needed () const
  • void 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 is num_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." β€” literally the whole personality in one sentence, no cap πŸ’€


🌈 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 it's a real "pick your fighter" situation βš”οΈ)

⭐ Constructor & Destructor Documentation ⭐

template<bool External_Load_Access = false, typename Size_Type  =
    std::size_t>
__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. defaults are 0.125 and 0.5, and yes those are exact, don't come for me 🫢


πŸ’œ Member Function Documentation πŸ’œ

template<bool External_Load_Access = false, typename Size_Type  =
    std::size_t>
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 = false, typename Size_Type  =
    std::size_t>
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 = false, typename Size_Type  =
    std::size_t>
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. she's keeping count, always πŸ”₯


template<bool External_Load_Access = false, typename Size_Type  =
    std::size_t>
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. main character energy: she said "resize" and the resize happened πŸ‘‘


template<bool External_Load_Access = false, typename Size_Type  =
    std::size_t>
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. order matters, bestie β€” min first, max second πŸ“


🌸 Author 🌸

Generated automatically by Doxygen for libstdc++ from the source code. (so nobody hand-wrote this, it's literally Doxygen doing its thing πŸ€–βœ¨)


ngl that's the whole page β€” every flag, every function signature, every protected notifier, all of it. nothing dropped, nothing invented. iykyk πŸ’…

and that's a wrap! this page came to you from the libstdc++ manual, auto-generated by Doxygen from the source code, and the footer shouted libstd__gnu_pbds::ha...ss, Size_Type >(3cxx) at us on the way out β€” bye bestie, go resize something responsibly πŸŽ€πŸ¦‹πŸ’–