title: How to compare c++ std::map with custom comparison function for associated data?
body: <pre><code>std::map&lt;String, double&gt; m1,m2;
  m1["A"] = 20;
  m2["A"] = 20.01;
  
  if (m1 == m2)
      cout &lt;&lt; "True";
  else
      cout &lt;&lt; "False";
  </code></pre>
  
  <p>The sample code prints False because 20 is not equal to 20.1. However in my application I want to treat these value as equal because of the difference between these values are with in allowable tolerance. So is there any way to provide a custom comparison function for data(not for Key)?</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Edited :
  Sorry for the mistake in the code. I copied the code which I tried to find the solution for this problem. The keys must be equal for my scenario.</p>