STD::__DETAIL::_MAP_BASE(3cxx)
π std::__detail::_Map_base β¨
okay bestie, buckle up, because this one is a deep cut β like, we're in the __detail namespace, which is basically the group chat nobody's supposed to screenshot. it's a libstdc++ internal (the 3cxx manual, so you know it's giving C++ standard library energy), and it's the sneaky little base class that makes your unordered_map go brrr. π«Ά
πΈ NAME πΈ
std::__detail::_Map_base< _Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, _Unique_keys > β literally just the whole template parameter list as a name, no cap. that's the vibe here. π
β¨ SYNOPSIS β¨
first thing's first, the include, and yes it's a detail header so be normal about it:
#include <hashtable_policy.h>
π Inherited by
this thing is the mother of a whole nepo-baby lineup, bestie. the following all inherit from it:
std::_Hashtable< _Key, _Tp, _Hash, _Pred, allocator< std::pair< const _Key, _Tp > > >std::_Hashtable< _Key, _Tp, hash< _Key >, equal_to< _Key >, allocator< std::pair< const _Key, _Tp > > >std::_Hashtable< _Value, hash< _Value >, equal_to< _Value >, allocator< _Value > >- and
std::_Hashtable< _Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits >
like, four whole _Hashtables claiming this as their ancestor?? iconic. generational talent fr fr. π
π Detailed Description π
so here's the actual declaration, and yes we're reading it exactly as written, every typename accounted for:
template<typename _Key, typename _Value, typename _Alloc, typename
_ExtractKey, typename _Equal, typename _H1, typename _H2, typename
_Hash, typename _RehashPolicy, typename _Traits, bool _Unique_keys =
_Traits::__unique_keys::value>
struct std::__detail::_Map_base< _Key, _Value, _Alloc, _ExtractKey,
_Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, _Unique_keys >"Primary
class template _Map_base.
the official summary is literally "Primary class template _Map_base." β short, sweet, main character energy. periodt. β¨
now for the tea, the part that actually matters: π
- if the hashtable's value type is of the form
pair<T1, T2>, and its key extraction policy (_ExtractKey) returns the first part of that pair β then boom, the hashtable gets amapped_typetypedef. yes bestie, that's wheremapped_typecomes from. you're welcome. - if it satisfies both of those criteria and it also has unique keys, then it also gets an
operator[]. that's right βoperator[]is a privilege, not a right, and it's reserved for the unique-keys girlies only. π
lowkey important: both of those perks are conditional. no pair value type or no first-part key extraction, andmapped_typesays bye. add non-unique keys to the mix andoperator[]ghosts you entirely. π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
i cannot with the fact that nobody hand-wrote this β it's Doxygen doing its thing, and honestly? slay, automated queen. π€π
and that's the whole page, bestie!! this was std::__detail::_Map_base< ... _Unique_keys > from the 3cxx manual β a libstdc++ internal, generated by Doxygen straight from the source code, footer and all (yes, the footer got a lil mangled into libststd::__detail::... _Unique_keys >(3cxx), we don't talk about it π). go forth and let your hashtables inherit responsibly. mwah. πβ¨
π¦ 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