The following code works:
template<typename T> class OtherClass
{
public:
T member;
};
template<typename T> class MyClass
{
public:
vector<vector<OtherClass<T> > * > stacks;
};
template<typename T>
static vector<vector<OtherClass<T> > * > MyClass<T>::stacks =
vector<vector<OtherClass<T> > * >(1024);
But this one does not:
template<typename T> class MyClass
{
public:
class OtherClass
{
public:
T member;
};
static vector<vector<OtherClass> * > stacks;
};
template<typename T>
vector<vector<MyClass<T>::OtherClass> * > MyClass<T>::stacks =
vector<vector<MyClass<T>::OtherClass> * >(1024);
gcc complains amongst other things: error: type/value mismatch at argument 1 in template parameter list for 'template class vector'
Any idea how to nest the class?
Thanks!