Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

AikonIV

STL multimaps

This topic is 5598 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

I''ve been searching around with google and have found very little info on multimaps. I understand the map concept well enough, and how multimaps allow duplicate keys, but I haven''t found anything on how to access data in multimaps. What I need to know is how to access the data in each of the keys matching whatever key I''m currently operating on.

Share this post


Link to post
Share on other sites
Advertisement
Your first port of call should be to the SGI STL documentation,and in particular their multimap page. That should tell you all that you need to know, if you read long enough. Basically you would use the equal_range function to get a pair of iterators to the relevant values, and iterate through them. A multimap element is a pair, where the .first element of that pair is the key and the .second element is the value. So your code will probably do something with ''myIterator->second'' while stepping myIterator through the range returned by equal_range.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites

  • 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!