sorting descending in a map of map

Sep 12, 2019 at 10:21am
hi

i have a map in the below map of map, with sorting in descending, but the
mMap1.insert(pair<string,map<string,string>>("SC-20", m1)) is showing error.
How can this be done.

map<string, map<string, string>, greater<int>> mMap1;
map<string, string> m1;
m1.insert(make_pair("12", "6.5"));
m1.insert(make_pair("13", "6.6"));
m1.insert(make_pair("14", "6.9"));

mMap1.insert(pair<string,map<string,string>>("SC-20", m1));

With Regards

Sep 12, 2019 at 10:49am
mMap1.insert(pair<string,map<string,string>>("SC-20", m1)) is showing error.
The reason is that greater<int> expects int while you provide string for comparison: greater<string>
Sep 12, 2019 at 11:59am
Hi

Thank you very much, i am such a dumb.
Topic archived. No new replies allowed.