Suppose we have
template<typename T>
class Base
{
...
protected:
template<typename U>
void compute(U x);
...
};
Now I want to call this method from a derived class. With non-template member functions I would normally use using ...
declaration or access members with this->...
. However, it's not clear how to access template members:
template<typename T>
class Derived : public Base<T>
{
// what's the correct syntax for
// using ... template ... Base<T>::compute<U> ... ?
...
void computeFloat()
{
float x = ...;
compute<float>(x);
}
void computeDouble()
{
double x = ...;
compute<double>(x);
}
...
};