title: Compile error: base operand of ‘->’ has non-pointer type ‘Token’
body: <p>I get the error mentioned in the title when trying to compile my c++ code.  I'm having trouble understanding what I did wrong here.</p>
  
  <p>The compiler has a problem with my implementation of the <code>bool operator==(Token )</code> function.  I thought this was the way to overload an operator.  </p>
  
  <p>Any clues as to why the compiler doesn't like me referring to 
  <code>this-&gt;terminal</code> or <code>this-&gt;lexeme</code>?</p>
  
  <pre><code>class Token {
      public:
          tokenType terminal;
          std::string lexeme;
          Token *next;
  
          Token();
          bool operator==(Token &amp;t);
      private:
          int lexemelength, line, column;
  };
  
  bool Token::operator==(Token &amp;t) {
      return ((this-&gt;terminal == t-&gt;terminal) &amp;&amp;
              (this-&gt;lexeme == t-&gt;lexeme));
  }
  </code></pre>