__GNU_PBDS::HASH_STANDARD_RESIZE_POLICY(3)
π NAME π
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type > β a resize policy which delegates operations to size and trigger policies. π
okay bestie, this page lives in the Library Functions Manual, section 3, so you know it's the real deal for library calls. π«Ά
β¨ SYNOPSIS β¨
#include <hash_policy.hpp>
It inherits from __gnu_pbds::hash_exponential_size_policy< Size_Type >, and __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >. β¨ family tree moment β¨
π Public Types π
enum { external_load_access }enum { external_size_access }typedef Size_Policy size_policytypedef Size_Type size_typetypedef Trigger_Policy trigger_policy
π¦ Public Member Functions π¦
hash_standard_resize_policy ()β Default constructor. no thoughts, just vibes πΈhash_standard_resize_policy (const Size_Policy &r_size_policy)β constructor taking some policies;r_size_policywill be copied by theSize_Policyobject of this object.hash_standard_resize_policy (const Size_Policy &r_size_policy, const Trigger_Policy &r_trigger_policy)β constructor taking some policies.r_size_policywill be copied by theSize_Policyobject of this object.r_trigger_policywill be copied by theTrigger_Policyobject of this object.size_type get_actual_size () constβ Returns the actual size of the container.std::pair< float, float > get_loads () constβ Returns a pair of the minimal and maximal loads, respectively.Size_Policy & get_size_policy ()β Access to theSize_Policyobject used.const Size_Policy & get_size_policy () constβ Const access to theSize_Policyobject used.Trigger_Policy & get_trigger_policy ()β Access to theTrigger_Policyobject used.const Trigger_Policy & get_trigger_policy () constβ Access to theTrigger_Policyobject used.void resize (size_type suggested_new_size)β Resizes the container tosuggested_new_size, a suggested size (the actual size will be determined by theSize_Policyobject).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_exponential_size_policy< Size_Type > &other)void swap (hash_load_check_resize_trigger &other)void swap (hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type > &other)
π Protected Member Functions π
size_type get_nearest_larger_size (size_type size) constsize_type get_nearest_smaller_size (size_type size) constsize_type get_new_size (size_type size, size_type num_used_e) constβ Queries what the new size should be, when the container is resized naturally. The current__sizeof the container issize, and the number of used entries within the container isnum_used_e.bool is_grow_needed (size_type size, size_type num_entries) constbool is_resize_needed () constvoid notify_cleared ()void notify_erase_search_collision ()void notify_erase_search_end ()void notify_erase_search_start ()void notify_erased (size_type num_e)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_e)void notify_resized (size_type new_size)
πΈ DETAILED DESCRIPTION πΈ
template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
class __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >
"A resize policy which delegates operations to size and trigger policies." it's giving middle management but make it generic π
π§ MEMBER ENUMERATION DOCUMENTATION π§
template<bool External_Load_Access = false, typename Size_Type = std::size_t>
anonymous enum [inherited]
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 π
hash_standard_resize_policy ()
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::hash_standard_resize_policy ()
Default constructor. no cap, it just exists πΈ
hash_standard_resize_policy (const Size_Policy & r_size_policy)
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::hash_standard_resize_policy (const Size_Policy & r_size_policy)
constructor taking some policies β r_size_policy will be copied by the Size_Policy object of this object. π
hash_standard_resize_policy (const Size_Policy & r_size_policy, const Trigger_Policy & r_trigger_policy)
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::hash_standard_resize_policy (const Size_Policy & r_size_policy, const Trigger_Policy & r_trigger_policy)
constructor taking some policies. r_size_policy will be copied by the Size_Policy object of this object. r_trigger_policy will be copied by the Trigger_Policy object of this object. two policies, one icon π
π₯ MEMBER FUNCTION DOCUMENTATION π₯
get_actual_size () const [inline]
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_type
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_actual_size () const
Returns the actual size of the container. the truth, the whole truth β¨
get_loads () const [inline], [inherited]
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
Returns a pair of the minimal and maximal loads, respectively. π
get_new_size (size_type size, size_type num_used_e) const [protected]
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_type
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_new_size (size_type size, size_type num_used_e) const
Queries what the new size should be, when the container is resized naturally. The current __size of the container is size, and the number of used entries within the container is num_used_e. protected, so bestie, this one's for the class itself, not for you π
get_size_policy ()
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
Size_Policy &
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_size_policy ()
Access to the Size_Policy object used. π
get_size_policy () const
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
const Size_Policy &
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_size_policy () const
Const access to the Size_Policy object used. look but don't touch energy β¨
get_trigger_policy ()
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
Trigger_Policy &
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_trigger_policy ()
Access to the Trigger_Policy object used. π
get_trigger_policy () const
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
const Trigger_Policy &
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_trigger_policy () const
Access to the Trigger_Policy object used. π
resize (size_type suggested_new_size)
template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
void
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::resize (size_type suggested_new_size)
Resizes the container to suggested_new_size, a suggested size (the actual size will be determined by the Size_Policy object). emphasis on suggested, bestie β the Size_Policy has final say π
set_loads (std::pair< float, float > load_pair) [inherited]
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. not a human, just a very caffeinated robot π€β¨
and that's the whole page, bestie π«Ά this one shipped as part of libstdc++ (the GNU C++ standard library), and it's filed under the __gnu_pbds...Size_Type >(3) manual page. go forth and resize responsibly πππ¦
π¦ 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