Sorting std :: mapa usando el valor
Necesito ordenar unstd::map
por valor en lugar de por clave. ¿Hay una manera fácil de hacerlo?
Obtuve una solución del siguiente hilo:
std :: ordenar por mapa los datos
¿Hay una mejor solución?
map<long, double> testMap;
// some code to generate the values in the map.
sort(testMap.begin(), testMap.end()); // is there any function like this to sort the map?