I get the error mentioned in the header when trying to compile my C ++ code. I am having trouble understanding what I did wrong.
The compiler has a problem with my implementation of the bool operator==(Token ) function. I thought this was a way to overload the operator.
Any hints as to why I don't like the compiler by referring to this->terminal or this->lexeme ?
class Token { public: tokenType terminal; std::string lexeme; Token *next; Token(); bool operator==(Token &t); private: int lexemelength, line, column; }; bool Token::operator==(Token &t) { return ((this->terminal == t->terminal) && (this->lexeme == t->lexeme)); }
source share