title: How can I create my own comparator for a map?
body: <pre><code>typedef map&lt;string, string&gt; myMap;
  </code></pre>
  
  <p>When inserting a new pair to <code>myMap</code>, it will use the key <code>string</code> to compare by its own string comparator. Is it possible to override that comparator? For example, I'd like to compare the key <code>string</code> by its length, not by the alphabet. Or is there any other way to sort the map?</p>