Possible Duplicate:
GCC problem : using a member of a base class that depends on a template argument
template <typename AType, typename OuterClass>
class A{
public:
A (AType a, OuterClass & b) : a(a), b(b) { }
AType a;
const OuterClass & b;
};
template <typename T>
class B {
public:
class C : public A<int, B> {
C(const B & b) : A<int, B>(0, b) {}
int getA() { return a; }
};
};
This code is a little long, but it's the minimal example I could find to reproduce my problem. Class C should inherit field "a" from its superclass A, and visual c++ compiles it without errors. But for some reason under gcc, in function getA I get "error: ‘a’ was not declared in this scope". What's wrong with this code and how can I make it more portable?