Quote:Original post by Fruny
Quote:Original post by iMalc
No, but you only ever need to use "this->" if you have local variables with the same names as members, which may be a bad idea anyway.
That's not the only case. If you have a class template and are referring to a base class template member, it is necessary to either specify this-> or properly qualify the name:
foo = 42; // Doesn't work this->foo = 42; // Works Base<T>::foo = 42; // Works
Wow, I didn't know about that two-stage name lookup stuff, even though in the past I've had to use the Base<T>:: syntax, (which I prefer actually).
Technically my statement still stands, as it seems that using this-> is merely one of two ways of overcomming the situation. Not meaning to sounds too picky though. Thanks for the info!