   Iterators and templates
  Hi All,i have just run into a C++ problem. I have got a map in my template class. The key item is the a template type.I am unable to iterate through my map because my code does not compile. I have tried typedef declarations but did not help.Here is the code:template <typename T>class ObjectPool{std::map<T*, bool> mPool;int mPoolSize;public:~ObjectPool();ObjectPool(int poolsize);T* GetObject();void ReleaseObject(T* object);};template<typename T>ObjectPool<T>::~ObjectPool(){map<T*, bool>::iterator it = mPool.begin(); //this line will not compile for(;it != mPool.end();++it){delete (*it).first;}}Any ideas?   
typename std::map<T*, bool>::iteratoriterator is dependant on the type T.;  And what should i do?   ;Quote:Original post by EverIceAnd what should i do?Go for a walk? Have a drink of tea?I do hope you are joking. There are only two lines in my reply, one of which is code and the other an explanation.   ;  Oops, I skipped the typename keyword. Thanks, that is solved.   