Why the Base class' name is required while trying to call the Base class' template function from the Derived class' function of same name?
Consider this code:
struct Base
{
template < typename >
void foo() { }
};
struct Derived : public Base
{
void foo()
{
Base::foo<int>(); // PASSES
foo<int>(); // FAILS!
}
void bar()
{
foo<int>(); // Passes if Derived::foo is not there and fails if it is there
}
};
Is this according to the standard? Both GCC and clang behave the same way here.