I'm trying to add a multimap as a member of a template class and I'm having trouble declaring and iterator. It seems to work when I declare the multimap member but not the iterator.
The error i get is "expected ';' before pos"Code:#include <iostream> #include <vector> #include <map> #include <iomanip> using namespace std; template <class T> class Test{ typedef multimap<T,int> MMap; public: MMap data; multimap<T,int>::iterator pos; }; int main() { std::cout << "Hello world!" << std::endl; return 0; }
Is there a fix to this or am I asking too much?
Thanks




Reply With Quote