title: std::map unique std::less<> function for a 2D point as key
body: <p>Well, after four hours of debugging, confused as I could be, I found out the cause of the problem...</p>
  
  <p>I am making some program that saves some point in a std::map and render those in my window.
  But weirdly, some points failed to make it into the map.</p>
  
  <pre><code>std::map&lt;Point2, Prop*&gt; m_Props_m;
  
  void AddProp(std::pair&lt;Point2, Prop*&gt; p)
  {
      m_Props_m.insert(p);
  }
  
  struct Point2
  {
  unsigned int Point2::x;
  unsigned int Point2::y;
  //--------
  Point2::Point2()
      :x(0)
      ,y(0)
  {}
  
  bool Point2::operator&lt; (const Point2&amp; b) const
  {
      return ( x+y &lt; b.x+b.y );
  }
  
  bool Point2::operator&gt; (const Point2&amp; b) const
  {
      return ( x+y &gt; b.x+b.y );
  }
  };
  </code></pre>
  
  <p>Thank god I have some experience with binary trees so I could find out the cause of my problem.</p>
  
  <p>Imagine we have 2 Point2's.</p>
  
  <pre><code>Point2 a(0,1);
  Point2 b(1,0);
  </code></pre>
  
  <p>As you can see, with the operator&lt; method I have written it would return false, and the operator> would also return false. Thus if a is already in the map, and b gets inserted, the insertion fails.</p>
  
  <p>Now, this is all good and well, but how can I fix this? Is there any way I could have a less than operator for a 2D point that would allow me to store every unique point in the map?</p>