What's difference between member1, member2, member3 on CLS class ?
Semantically, there's no difference in this case.
The additional qualifiers are sometimes needed to disambiguate names, when the name is shadowed, or when looking up a non-dependent name inherited from a dependent base-class.
For completeness, you could also add a fourth case:
1 2 3
|
void CLS::member4() {
printf("%s\n", this->CLS::name);
}
|
which is always redundant, as far as I know. (don't bet on it.)
If you conform to the practice of fully-qualifying names, it is a good idea to use
this->
, instead of writing the name of the class (which might change) again and again.