Jump to content
  • Advertisement
Sign in to follow this  
adtheice

dictionary vs list vs um something

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

Ok currently i'm using the standard libraries vector container. what i need is something similar to a dictionary, i ask for a specific name and i'm passed the object that relates to that name. while i need this i _also_ need to be able to traverse the collection in order (backwards and forwards) and finally i need to be able to insert and remove items into the collection in specific order. I was thinking of using a dictionary collection then having a list inside the collection that stores the order of traversal then when you ask to traverse the list it simply returns the dictionary items in the order of the list. anyone have a different suggestion?

Share this post


Link to post
Share on other sites
Advertisement
c++ sorry, i assumed it was clear when i said i was using the standard template library.

but now that i think about it other languages have a standard library also don't they? =P silly me.

Share this post


Link to post
Share on other sites
By "dictionary collection" do you mean std::map then? std::map will let you iterate over the elements in order, both backwards and forwards.

Share this post


Link to post
Share on other sites
this will work perfectly. see thats why i was asking. i rarely ever used c++ so i knew i was missing stuff from the standard library that i needed to use.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!