title: Checking for duplicates in a vector
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2769174/determining-if-an-unordered-vectort-has-all-unique-elements">Determining if an unordered vector&lt;T&gt; has all unique elements</a>  </p>
  </blockquote>
  
  
  
  <p>I have to check a vector for duplicates. What is the best way to approach this:</p>
  
  <p>I take the first element, compare it against all other elements in the vector. Then take the next element and do the same and so on.</p>
  
  <p>Is this the best way to do it, or is there a more efficient way to check for dups?</p>