title: How to count the number of distinct values in a C++ std::map<Key,Values>
body: <p>I have a c++ map declared as follows</p>
  <pre><code>std::map&lt;std::string, int&gt; wordMap= {
      { &quot;is&quot;, 6 },
      { &quot;the&quot;, 5 },
      { &quot;hat&quot;, 9 },
      { &quot;at&quot;, 6 } 
      };
  </code></pre>
  <p>I would like to know how to find the number of distinct values of <code>int</code> existing in <code>wordMap</code>.
  In this example, I would expect an output of 3 as i have 3 different distinct values <code>(6,5,9)</code>.</p>