take a look at this code:
template <class T>
class C {
public:
class A {
protected:
int x;
};
class B: public A {
protected:
void write() {
cout << x << endl;
}
};
};
when I try to compile with g++ i get:
test.cpp: In member function ‘void C<T>::B::write()’:
test.cpp:18: error: ‘x’ was not declared in this scope
If I remove the template argument of class C all workes fine ( of course )
Does anyone have an ideea of what is going on?
thx in advance