Original Post
I was under the impression that templates in C++ were actually handled at compile time to generate classes as necessary, and yet I've managed to come across something that doesn't work...
So here's my question: is it simply due to the fact that you can't use templates within templated classes (and if so, why do vectors work fine?), or is there something wrong with my understanding of templates, or is there something wrong with GCC?
class Works { std::map<std::string,int> testMap; //this doesn't compile, as it shouldn't, since it does nothing //std::map<std::string,int>::iterator; //compiles fine typedef std::map<std::string,int>::iterator TestIterator;};template<typename T>class Broken { std::map<std::string,T> testMap; //this compiles, but is completely useless std::map<std::string,T>::iterator; //doesn't compile typedef std::map<std::string,T>::iterator TestIterator;};So here's my question: is it simply due to the fact that you can't use templates within templated classes (and if so, why do vectors work fine?), or is there something wrong with my understanding of templates, or is there something wrong with GCC?