std::__detail:...e_rehash_policy(3cxx)
π NAME π
std::__detail::_Prime_rehash_policy β bestie, this is the default value for rehash policy. And the bucket size? It's (usually) the smallest prime that keeps the load factor small enough. Primes, we love to see it. β¨
(also hi, this whole thing lives in the 3cxx manual, i.e. the C++ library pages, iykyk π¦)
π SYNOPSIS π
#include <hashtable_policy.h>
πΈ Public Types πΈ
using __has_load_factor = true_typeβ it'strue_type, which means this policy has a load factor. Confirmed, no notes. βtypedef std::size_t _Stateβ the state type is literally just astd::size_t. Simple, effective, unbothered. π«Ά
π Public Member Functions π
_Prime_rehash_policy (float __z=1.0) noexceptβ constructor moment!! takes afloat __zthat defaults to1.0, and it'snoexcept, so it will not be throwing hands. πstd::size_t _M_bkt_for_elements (std::size_t __n) constβ takes__n, astd::size_t, and hands you back astd::size_t. It'sconst, so it stays in its lane and touches nothing. β¨std::pair< bool, std::size_t > _M_need_rehash (std::size_t __n_bkt, std::size_t __n_elt, std::size_t __n_ins) constβ three args, allstd::size_t, named__n_bkt,__n_eltand__n_ins, and it returns astd::pair< bool, std::size_t >. Alsoconst. The name says need rehash, so make of that what you will. πstd::size_t _M_next_bkt (std::size_t __n) constβ__nin,std::size_tout,constthe whole time. πvoid _M_reset () noexceptβ no args, returnsvoid, and it'snoexcept. Just... reset. π§Όvoid _M_reset (_State __state)β the overload that takes a_State __stateand returnsvoid. Two resets, one queen. π_State _M_state () constβ gives you back a_State, and yeah it'sconst. πΈfloat max_load_factor () const noexceptβ returns afloat,const,noexcept. Max load factor, served fresh. π
π Public Attributes π
float _M_max_load_factorβ afloat, just vibing out in public like that. πstd::size_t _M_next_resizeβ astd::size_t, also out here in the open. The audacity, the confidence. β¨
β Static Public Attributes β
static const std::size_t _S_growth_factorβstatic,const,std::size_t. It's giving constant, it's giving shared across everything. Iconic. π₯
π¦ Detailed Description π¦
So, to recap the whole lore: this is the default value for rehash policy, and the bucket size is (usually) the smallest prime that keeps the load factor small enough. That's it, that's the thesis. πΈ
β¨ Author β¨
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, not a bestie, just a robot doing its little thing. π€π
okay that's the page!! π«Ά the footer at the very bottom is the classic combo β the libstdc++ source name, the 3cxx manual section, and the page date riding along with it, exactly as it shipped. mwah, go rehash something responsibly. π
π¦ where this page comes from
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms