#include <iostream>
class Base {
public:
void m1() { std::cout << "Base::m1\n"; }
// ...
};
template<class T>
class Derived : public T { // dependent base class
public:
void test1() {
#ifdef ERR
m1(); // error: there are no arguments to `m1' that depend on a template parameter,
// so a declaration of `m1' must be available
#endif
}
void test2() {
this->m1(); // O.K. with this
}
// ...
};
int main() {
Derived<Base> o;
std::cout << "main:\n";
o.test1();
o.test2();
}