I have a map of time stamps and some data map<string,double> mymap; how can i sort this by the time stamp so that everything is in chrnological order?
heres a sample data set of whats inside,
what i have.
< timestamp , data>
"2011-02-04 14:14:51" 1
"2010-09-24 07:45:13" 2
"2011-10-28 11:10:32" 3
"2008-10-27 11:10:32" 4
"2008-10-27 11:10:33" 5
desired result
"2008-10-27 11:10:32" 4
"2008-10-27 11:10:33" 5
"2010-09-24 07:45:13" 2
"2011-02-04 14:14:51" 1
"2011-10-28 11:10:32" 3
std::mapshould always be sorted:The only thing I can think of is that it’s not comparing the strings correctly. Using an integer or a format designed to store dates may help.