dictionary vs list vs um something
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?
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.
but now that i think about it other languages have a standard library also don't they? =P silly me.
By "dictionary collection" do you mean std::map then? std::map will let you iterate over the elements in order, both backwards and forwards.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement