title: Case insensitive search in std::map using std::find
body: <p>I need to <strong>find the string form the vector list through case insensitive comparison</strong>. Is there is some easy solution for it without using Boost?</p>
  
  <p>My code I have written for case sensitive search is:</p>
  
  <pre><code>std::map&lt;std::string, std::string&gt;::const_iterator it;
  if (map.end() != (it = map.find(mKey)))
      // if word matches
  </code></pre>
  
  <p>Suggested by one answer I have used <code>find_if</code> and got the following exception. It is giving following error at particular value</p>
  
  <pre><code> my_map1["$$HYPHEN{{a"] = "-"; 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/tAhIB.jpg" alt="enter image description here"></p>
  
  <p>Code tried using <code>lexicographical_compare</code>:</p>
  
  <pre><code>std::map&lt;std::string, std::string&gt; map1;
  std::map&lt;std::string,
           std::string,
           bool(*)(const std::string&amp;, const std::string&amp;)&gt;
       my_map_temp(case_insensitive_string_cmp);
  my_map_temp["$$HYPHEN--a"] = "foo";
  my_map_temp["$$HYPHEN{{a"] = "foo1";
  while (my_map_temp.end() !=  my_map_temp.find("$$HYPHEn--a"))
      {
         std::cout &lt;&lt; my_map_temp["hellOOOO"] &lt;&lt; std::endl;
      }
  </code></pre>
  
  <p>But in this case how can I copy <code>map1</code> values to <code>my_map_temp</code>?</p>