At the moment my solution is to iterate through the map to solve this.
I see there is a upper_bound method which can make this loop faster, but is there
upper_bound
The entries in a std::map are sorted, so for a std::map m (assuming m.empty() is false), you can get the biggest key easily: (--m.end())->first
m.empty()
(--m.end())->first