title: Operator Overloading (==)
body: <p>I'm having some difficulty with this. I've determined I need to overload this operator for my personal project. It is necessitated by the use of the following line:</p>
  
  <pre><code>if(playerVec[i] == 0)
  </code></pre>
  
  <p>The player class has several data members for calculating one particular data member, mInitiative. This is the one I want to check in my if condition. Here is my attempt at overloading it:</p>
  
  <pre><code>bool operator==(const Player&amp; lhs) const {
      return mInitiative == lhs.mInitiative;
  }
  </code></pre>
  
  <p>It seems fine enough, but the error persists. If I want to compare that particular player datum to an integer (in this case, 0), how do I go about it? What's the mistake in my approach?</p>
  
  <p><strong>EDIT:</strong> I have tried:</p>
  
  <pre><code> bool operator==(const Player&amp; lhs, int rhs) const {
      //...
   }
  </code></pre>
  
  <p>But the compiler says there are too many parameters for the function. Why is this? Shouldn't == be able to take two? </p>
  
  <p>Thanks!</p>