title: How to use tolower with lambda function in map? C++
body: <p>I want to change all the words stored in a map to lower case. with lambda function and transform, how should I do that?</p>
  
  <pre><code>std::map &lt;string, int&gt; M;
  std::map&lt;string, int&gt; M1;
  
  std::transform(M.begin(), M.end(), M1.begin(),
           [](pair&lt;const string, int&gt; const &amp; p) { ::tolower(p.first); });
  </code></pre>