title: Overloading comparison operators
body: <p>I'm having trouble overloading the comparison operators <code>&gt;</code> and <code>&lt;</code>. I've tried two different ways but I'm still having trouble.</p>
  
  <pre><code>bool Car::operator ==(const Car &amp;car)
  {
      return mLNumber == car.GetNum();
  }
  
  bool Car::operator &lt;(const Car &amp;carB)
  {
      return mLNumber &lt; carB.GetNum(); 
  }
  bool Car::operator &gt;(const Car &amp;carB)
  {
      return mLNumber &gt; carB.GetNum(); 
  }
  int Car::GetNum()
  {
      return mLNumber;
  }
  </code></pre>
  
  <p>My <code>==</code> operator works just fine. I get the error that these operators don't exist. Here is my 2nd attempt.</p>
  
  <pre><code>bool Car::operator &lt;(const Car &amp;carA, const Car &amp;carB)
  {
      return carA.GetNum() &lt; carB.GetNum(); 
  }
  bool Car::operator &gt;(const Car &amp;carB)
  {
      return carA.GetNum() &gt; carB.GetNum(); 
  }
  </code></pre>
  
  <p>And I get the error that there are too many parameters. I also get this:</p>
  
  <pre><code>'Car::GetNum' : cannot convert 'this' pointer from 'const Car' to 'Car &amp;' 
  </code></pre>