SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Did you know? => Topic started by: Lisa on April 22, 2008, 01:50:52 PM

Title: Navigate to an Overloaded Operator
Post by: Lisa on April 22, 2008, 01:50:52 PM
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.

Code: [Select]
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");
   }
   //...
   
}
Title: Re: Navigate to an Overloaded Operator
Post by: raj2all on May 06, 2008, 07:46:27 AM
that's good feature I was not aware of.

But it seems like this feature is not working for Function call operator ( () )

Regards