Hi,
I want to make a subclass of QList for any type T.
Since I'm not very familiar with templates inheriting, I try to make a mirror copy of QList first.
This is my my_list.h header file
Code:
template <class T> class MyList : public QList<T> { public: };
I try to use MyList as a QList in the main program, but the code cannot be compiled.
The error is :
Code:
error C2059: syntax error : '~' while compiling class template member function 'MyList<T>::~MyList(void)' with [ T = MyObject *] see reference to class template instantiation 'MyList<T>' being compiled with [ T = MyObject *]
How should I fix the error to create a template works exactly as QList?
Thanks in advance.