Jump to content
  • Advertisement
Sign in to follow this  
graveyard filla

question about std::hash_map

This topic is 5015 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, does anyone know if a std::hash_map has the same property of a std::set and std::map in that all pointers and iterators to items in the container will always remain valid, unless of course they are erased from the map? i cant find any mention of this in the STL docs (yes i know that hash map is only an extension). thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
After reading various stl references from SGI, it seems that when iterators are not invalidated, it is explictly mentioned in the reference (see map, set, list), and when they can be invalidated it is not mentioned (see vector).

Since the non-invalidation of iterators is not mentioned for the hash_map, I can only assume they could be invalidated by deletion or insertion (although that does not mean they will be, but don't play with fire if you want to keep your limbs attached).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!