You should do it like this :
template<typename T>
class derived : public base<T>
{
public:
void bar()
{
base<T>::template foo<int>();
}
};
Here is full compilable example :
#include <iostream>
template<typename T>
class base
{
public:
virtual ~base(){}
template<typename F>
void foo()
{
std::cout << "base::foo<F>()" << std::endl;
}
};
template<typename T>
class derived : public base<T>
{
public:
void bar()
{
base<T>::template foo<int>(); // Compile error
}
};
int main()
{
derived< int > a;
a.bar();
}