I need a recommendation on how to implement a container type/what existing container type(s) to use for this situation: I need to have a list of objects that may or may not be the same, and each object needs to have, or be associated with, a name. No two objects in the list may have the same name, but I can't use a map because I need to maintain an exact, unsorted order.
Basically, is/are there already a container/containers that are designed for this, or will I just have to do something like a vector<pair<string, MyType> > and make sure no two have the same name when inserting/renaming?
EDIT: Essentially, I'm looking for something similar to an unsorted map container...
And it's problem solved, again. I just have to make sure not to use reverse iterators with rbegin(), as apparently the reverse iterator can move, even when it shouldn't.
I would like to know, however, why my output differs like that. Why is the reverse iterator changing what it points to, whereas the normal iterators are not?
That's strange. I get the same output as you, but when pausing and checking in the debugger for VS2008 "rt" has a strange value. I'm not sure what the problem is.