When compiling this code I get an unresolved external symbol "public: static class Outer<int>::Inner Outer<int>::inner" with VC6 and "undefined reference to `Outer<int>::inner' " with g++. Perhaps Im missing something obvious but I cant figure it out. Any ideas?
Code:template <class T>
class Outer {
class Inner
{
public:
void f() {}
};
public:
static Inner inner;
};
int main()
{
Outer<int>::inner.f();
return 0;
}