title: How to add distinct pairs into a set?
body: <p>I am trying to insert a few pairs of <code>int</code> into a <em>set</em>, these pairs don't have any order; that is, <code>(1,2) = (2,1)</code>. So simply I do as follows,</p>
  
  <pre><code>typedef pair&lt;int, int&gt; pairs; 
  
  set&lt;pairs&gt; Set;
  pair &lt;int,int&gt; myPair;
  
  // adding pairs:
  myPair=pair&lt;int,int&gt;(0,1);
  pathSet.insert(myPair);
  myPair=pair&lt;int,int&gt;(0,2);
  pathSet.insert(myPair);
  myPair=pair&lt;int,int&gt;(1,0);
  pathSet.insert(myPair);
  </code></pre>
  
  <p>So I end up a set like </p>
  
  <pre><code>(0,1), (0,2) , (1,0)
  </code></pre>
  
  <p>I want to have </p>
  
  <pre><code>(0,1), (0,2)
  </code></pre>
  
  <p>How can I avoid duplicate? Is there any way? Is there any better ADT like <code>std::unordered_set</code> in terms of efficiency in comparison with 'set'?</p>