I was wondering if this-> should be used both:
void SomeClass::someFunc(int powder)
{
this->powder = powder;
}
//and
void SomeClass::someFunc(bool enabled)
{
this->isEnabled = enabled;
}
I’m wondering if the latter is necessary to be proper or if isEnabled = enabled would suffice.
Thanks
is needed when using the member directly would be ambiguous. This could happen with template code.
Consider this:
This will fail since calling testing() is dependent on a template parameter. To say that you mean the function you will have to do
this->testing();orFoo<T>::testing();Error message: