title: Repeated elements in a std::vector
body: <p>I have a <code>std::vector</code> and I want to check all the elements in it. If a certain element appears more than once, I signal an error.</p>
  
  <p>This is how I did it:</p>
  
  <pre><code>std::vector&lt;std::string&gt; test;
  test.push_back("YES");
  test.push_back("YES");
  
  for(int i = 0; i &lt; test.size(); i++)
  {
      if(test[i] &gt; 1)
      {
          DCS_LOG_DEBUG("ERROR WITH COUNT")
      }
  }
  </code></pre>
  
  <p>This did not work though I know how to count using the <code>std::vector::count()</code> method. But I want to get the count for each element, as opposed to counting everything... any ideas?</p>