• Forum
  • Lounge
  • Erroneous std::type_info::hash_code exam

Erroneous std::type_info::hash_code example

I am not sure where else to report this, but the example code on the std::type_info::hash_code page is erroneous.

There is no guarantee that hash codes are unique, so the following output is possible as well:

i is character
c is character

More generally, the approach of using hash codes as lookup keys is not valid and will result in unportable code, at best; the example should be removed or fixed.
Last edited on
There is a link at the bottom of every page of this website's reference, which says "Spotted an error? contact us"
Thanks, it's a small link so I missed it the first time.
Topic archived. No new replies allowed.