Notes:
C++ map elements are returned sorted. The sorting function is a template parameter. It's part of the container's data type.
Contrast this with Perl, where the keys must be manually sorted.