Did you know that you can use Ctrl+Dot to navigate to an overloaded operator in C++? Go to the line containing "toDo == toEat" and put your cursor on "==", then press Ctrl+Dot.
class Something {
//...
public:
bool operator == (const Something &rhs);
bool operator != (const Something &rhs);
//...
};
bool Something::operator ==(const Something &rhs) {
return true;
}
bool Something::operator !=(const Something &rhs) {
return !this->operator ==(rhs);
}
void main(int argc, char argv[])
{
Something toDo;
Something toEat;
//...
if ( toDo == toEat ) {
printf("It's time for lunch.\n");
}
//...
}