STD::__DETAIL::_HASHTABLE_TRAITS(3cxx)

πŸŽ€ NAME πŸŽ€

okay so bestie, gather round β€” this entire page is about one lil' struct and its whole personality:

std::__detail::_Hashtable_traits< _Cache_hash_code, _Constant_iterators, _Unique_keys >

It lives in the 3cxx section of the manual. That's the name, that's the vibe, that's it. πŸ’…


✨ SYNOPSIS ✨

Before you can even look at this thing you gotta pull in the header:

#include <hashtable_policy.h>

🌸 Public Types 🌸

Three typedefs. Three little bool-wrappers. All of them lowkey iconic:

  • __constant_iterators β€” it's an alias for __bool_constant< _Constant_iterators >
  • __hash_cached β€” it's an alias for __bool_constant< _Cache_hash_code >
  • __unique_keys β€” it's an alias for __bool_constant< _Unique_keys >

πŸ’– Detailed Description πŸ’–

Here's the template declaration, character for character, no edits from me:

template<bool _Cache_hash_code, bool _Constant_iterators, bool _Unique_keys>

and here's the struct:

struct std::__detail::_Hashtable_traits< _Cache_hash_code, _Constant_iterators, _Unique_keys >"struct _Hashtable_traits

(yeah, that trailing "struct _Hashtable_traits is literally how it appears on the page. We do not touch it. We do not "fix" it. We simply observe it and move on πŸ‘€)

The one-line summary: important traits for hash tables. That's the job description, and it ate. It's giving backstage-pass-to-the-unordered-containers energy 🎟️

🌈 Template Parameters 🌈

  • _Cache_hash_code β€” a Boolean value. True means the value of the hash function is stored right alongside the value. It's a time-space tradeoff, no cap. Storing it may improve lookup speed by cutting down how many times we need to call the _Hash or _Equal functors.
  • _Constant_iterators β€” a Boolean value. True when iterator and const_iterator are both constant iterator types. That's the case for unordered_set and unordered_multiset, and it's false for unordered_map and unordered_multimap.
  • _Unique_keys β€” a Boolean value. True if the return value of _Hashtable::count(k) is always at most one; false if it may be an arbitrary number. That one's true for unordered_set and unordered_map, and false for unordered_multiset and unordered_multimap.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. So nobody hand-wrote this one β€” it's a robot's masterpiece and honestly? The robot slayed πŸ€–βœ¨


mwah, that's the whole page πŸ’‹ It's a libstdc++ thing, filed under section 3cxx, spat out by Doxygen straight from the source. Go forth and be the main character of your own hashtable, bestie 🫢🌸

πŸ“¦ where this page comes from