std::type_index::hash_code(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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_code was not required to be noexcept. Correct behavior: required noexcept. Slay, now it's required. βœ…

🌈 See also 🌈

  • std::hash<std::type_index> β€” hash support for std::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