std::type_index::hash_code(3)
π NAME π
std::type_index::hash_code β like, the whole name, bestie. This is the <pink>std::type_index::hash_code(3)</pink> page from the <purple>C++ Standard Libary</purple> manual, and we're gonna get you comfy with it. π«Ά
β¨ Synopsis β¨
std::size_t hash_code() const noexcept; (since C++11)
Okay so this returns the hash code of the associated std::type_info object. Equivalent to calling type_info::hash_code directly. No extra drama, no secret sauce. π
π Parameters π
- (none) β yeah, zero parameters. She takes nothing. Not a single argument. π
πΈ Return value πΈ
The hash code of the associated std::type_info object. That's the whole return vibe. β
π¦ Example π¦
This section is incomplete Reason: no example
Not me leaving the example section empty π β the original literally says it's incomplete and gives the reason as "no example". So that's the tea.
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. Fr fr, here's the rundown:
- LWG 2144 β applied to C++11. Behavior as published:
type_index::hash_codewas not required to benoexcept. Correct behavior: requirednoexcept. Slay, now it's required. β
π See also π
std::hash<std::type_index>β hash support forstd::type_index(C++11) (class template specialization). It's giving supporting character energy, but make it useful. π
π Category π
- Todo no example
Shoutout to the footer, bestie: source is http://cppreference.com, version/date is 2024.06.10, and the page is std::type_index::hash_code(3). Byeee π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms