79685277

Date: 2025-06-30 20:51:46
Score: 2
Natty:
Report link

Boost provides a map with random-access iterators, so you can std::sort it:

#include <boost/container/flat_map.hpp>
#include <algorithm>

std::sort(your_map.begin(), your_map.end(), 
    [](const auto& a, const auto& b) { 
    return a.second != b.second?  a.second < b.second : a.first < b.first;  
});
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Richmakwood Op