template<class T>
class Outer {
public:
class Inner;
static Inner* x;
//...
class Inner {
//...
};
};
template<class T>
typename Outer<T>::Inner *Outer<T>::x = NULL;
As for
typename
andclass
, please refer to C++ difference of keywords 'typename' and 'class' in templatesWhy this, please refer to Trouble with dependent types in templates