You may have notice that later versions of gcc is more strict with standards (see this question)
All inherited members of a template class should be called using the full name, ie.
ParentClass<T>::member
instead of just member
But still I have a lot of old code that does not respect this. Adding using ParentClass<T>::member
for each used member in each class is quite a pain. Is there is a way to do something like using ParentClass<T>::*
?. I would like this better than deactivating this check in g++ but if there is now way, how can I deactivate it ?
Edit:
According to C++ FAQ (thanks sth) these are the only way to correctly solve the inherited member variable names :
Change the call from
f()
tothis->f()
. Since this is always implicitly dependent in a template,this->f
is dependent and the lookup is therefore deferred until the template is actually instantiated, at which point all base classes are considered.Insert
using B<T>::f
; just prior to callingf()
.Change the call from f() to
B<T>::f()
.
So now looking for the right switch to deactivate the full name resolution ...