Possible Duplicates:
Is there any reason to use this->
When should this-> be used?
When should I make explicit use of thethis
pointer?
When working with pointers to classes, I like to add a this->
in front of variables in a class to make it clearer that the variable I'm talking about is in the current class, as opposed to temporary variables, etc. So my lines would be something like
if(this->thing > other->thing)
this->doFoo();
Instead of
if(thing > other->thing)
doFoo();
Is it okay to add the superfluous this
, or would that degrade code readability?