I have the following header file:
Qt Code:
#include <list> using namespace std; template <class T> class QuickList { public: // Some public things private: list<T> _theList; mutable list<T>::iterator _currentPointer; };To copy to clipboard, switch view to plain text mode
When I try to compile, I get the following errors (line numbers changed to correspond with the code above:
I need the mutable keyword if I want to keep my consts intact. However, if I remove it, I still get this single error:In file included from quicklist.cpp:1:
quicklist.h:11: error: type `std::list<T, std::allocator<_CharT> >' is not derived from type `QuickList<T>'
quicklist.h:11: error: ISO C++ forbids declaration of `iterator' with no type
quicklist.h:11: error: expected `;' before "_currentPointer"
I don't understand these errors. What am I doing wrong?In file included from quicklist.cpp:1:
quicklist.h:11: error: expected `;' before "_currentPointer"
Could someone help me with this?
Thanks!
Bookmarks