title: Print duplicate values once in a multimap
body: <p>I have a multimap that contains <code>using myMap= std::multimap &lt;std::string, std::string&gt;;</code></p>
  
  <p>here is a sample data that's in it. </p>
  
  <pre><code>West;Tuulensuu
  West;Keskustori
  South;Sammonaukio
  West;Rautatieasema
  West;Tulli
  West;Sammonaukio
  East;Sammonaukio
  </code></pre>
  
  <p>I'd like to print just the values, but all the values should only be printed once and should be sorted.</p>
  
  <p>I've tried the following.</p>
  
  <pre><code>void print_lines(myMap&amp; tramlines)
  {
      for (auto it = tramlines.begin(); it != tramlines.end(); ) {
          std::string key = it-&gt;second;
  
          std::cout &lt;&lt; it-&gt;second &lt;&lt; std::endl;
  
          // Advance to next non-duplicate entry.
          do {
              ++it;
          } while (it != tramlines.end() &amp;&amp; key == it-&gt;second);
      }
  }
  </code></pre>
  
  <p>It still printed the values more than once. So I tried the following. </p>
  
  <pre><code>auto uniq = std::unique(tramlines.begin(), tramlines.end());
  tramlines.erase(uniq, tramlines.end());
  
  for(auto item : tramlines)
  {
      std::cout &lt;&lt; item.second &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>But that's giving me the following error</p>
  
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   C2679   binary '=': no operator found which takes a right-hand operand of type 'std::pair&lt;const _Kty,_Ty&gt;' (or there is no acceptable conversion)   Prog2Test
  </code></pre>
  
  <p>What are my options here? I can't find anything online that points to printing values, I've found plenty for Keys.</p>
  
  <p>Would iterating through the values and adding them to set and printing them out a good idea?</p>