Possible Duplicate:
how does the stl’s multimap insert respect orderings?
I have a multimap as follows -
multimap<string,string> myMultiMap;
myMultiMap[sKey] = s1;
myMultiMap[sKey] = s2;
myMultiMap[sKey] = s3;
I add s1,s2,s3 in sequence. Later on, I may pass by a value 1,2,3 and based on that get its value.
For instance, if I pass '1', I should get back s1.
If I do this - iterator = myMultiMap.equal_range(sKey);
get the value of the 1st element in the iterator list.
WIll this work? Does the iterator store the values for a key (in case of multiple values) in the order in which they were inserted?
Pls advise.
thx - Anand