I cannot say that for sure because you didn't post all the code.
The hidding situation is in accordance to the standard. This happens even for non-templates classes. The C++ lookup mechanism will not look further for in other scopes if it already finds a name match in the current class. Example:
One way to fix it is with a using directive. Just uncoment the part I mention above.Code:struct A { bool IsValid(int i) const {return true;} }; struct B : A { bool IsValid(int x, int y) const {return true;} //Uncomment below to fix. //using A::IsValid; }; int main() { B b; int i = 10; bool x = b.IsValid(i); //Error, only IsValid(int, int) from B is visible. /* ... */ }




Reply With Quote