title: std::map comparing pointers
body: <p>How would I implement the comparison operator in the example below so that <code>ObjectPair( &amp;a, &amp;b )</code> is equal to <code>ObjectPair( &amp;b, &amp;a )</code>?  In addition, how would I implement this using <code>stdext::hash_map</code> instead of <code>std::map</code>?</p>
  
  <pre><code>struct ObjectPair
  {
      public:
  
          ObjectPair( Object* objA, Object* objB )
          {
              A = objA;
              B = objB;
          }
  
          bool operator&lt;( const ObjectPair&amp; pair ) const
          {
              // ???
          }
  
          Object* A;
          Object* B;
  };
  
  int main()
  {
      std::map&lt; ObjectPair, int &gt; pairMap;
  
      Object a;
      Object b;
  
      pairMap[ ObjectPair(&amp;a, &amp;b) ] = 1;
      pairMap[ ObjectPair(&amp;b, &amp;a) ]++;    
  
      /// should output 2
      std::cout&lt;&lt; pairMap[ ObjectPair( &amp;a, &amp;b ) ] &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>