title: Is there a way for std::map to "edit" values like a predicate for the key?
body: <p>I am wondering if it is possible to create something like a predicate for a std::map for all of its values so I don't have to edit the values before I insert them into the map.</p>
  
  <p>What I would like is something like this:</p>
  
  <pre><code>mymap["username"] = " Marlon "; // notice the space on both sides of my name
  assert(mymap["username"] == "Marlon"); // no more whitespace
  </code></pre>
  
  <p>The context is I am creating a std::map for a .ini file and <strong>I would like it to automatically remove leading/trailing whitespace from the values when I want to retrieve them</strong>. I've already created a predicate to ignore casing and whitespace from the key so I want to know if it is possible to do the same for the value.</p>