I have this multimap built to display the distance from line interference to the corresponding line.
Since the distance between the two lines may be the same, I want them to be sorted in ascending order. However, when I print it, it is not sorted. HamdistArray is declared as an unsigned type.
typedef multimap<unsigned, string, less<unsigned> > Check;
Check pairs;
pairs.insert(Check::value_type(hamdistArray[j], d.sortedWordDatabase[j]));
for(Check::const_iterator iter = pairs.begin(); iter != pairs.end(); ++iter)
{
cout << iter->first << '\t' << iter->second<< endl;
}
source
share