Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi So I have a templated class @ template<typename T> class MyClass { .... } @
Is it possible to have a list of these? I'm guessing not as this does not compile @ QList<MyClass<T> > myList; @
Is there a way of achieving this?
Thanks
Hi,
What error are you getting ?
For example @QList< QVector<int> > myList;@
Builds without any problem
Hi I am trying to store the templated class not the instantiations
@ QList<MyClass<T> > myList; @
The error is T : undeclared identifier
Ok, that, AFAIK no you can't store a template class
What's your use case ?
Hi Thats what I thought
I want to associate a string with a particular instantiation of the template class
What would be the end-result ?
Hi
I think I will have to find another way
Thanks anyway
The solution is to derive the template from a base class @ class Base { Base() {} ~Base() {} };
template<class T> class MyTemplate : public Base { MyTemplate() {} ~MyTemplate() {} };
class MyStore { QList<const Base*> m_list; }
@