Originally Posted by
laserlight
Actually, I think it came up recently here (or maybe Codeguru, I get mixed up sometimes, especially with George2 around).
It happens when you try to access an inherited, non-dependent name in a derived class. Here we go:
Code:
#include <iostream>
template <typename T>
struct A
{
void hello()
{
std::cout << "A::hello()" << std::endl;
}
};
template <typename T>
struct B : public A<T>
{
B()
{
this->hello();
}
};
You might think the part highlighted in red can be removed. It can't be.