Saturday, 17 August 2013

Questions about STL containers in C++

Questions about STL containers in C++

How often do std::multimap and std::unordered_multimap shuffle entries
around? I'm asking because my code passes around references to distinguish
between entries with the same hash, and I want to know when to run the
reference redirection function on them.
What happens if I do this:
std::multimap Table; //Tyype specification stuff left out
//Code that pus in two entries with the same key, call that key foo
int bar = Table[foo];
Is the result different if it's an unordered_multimap instead?
Back to passing references around to distinguish entries with the same
hash. Is there a safer way to do that?

No comments:

Post a Comment