23.08.2013, 16:43, "Mandeep Sandhu" <mandeepsandhu....@gmail.com>: > Hi All, > > I'm writing a template class which contains a QHash. Now if I try to store an > Iterator (of a QList) as the _value_ of this Hash then it fails to compile. > > Here's the sample code: > > template <typename K, typename V> > class TemplateTest > { > public: > TemplateTest() > { > QHash<K, QLinkedList<V>::iterator > h; > Q_UNUSED(h); > } > > private: > K k; > V v; > };
Error from Clang: error: template argument for template type parameter must be a type; did you forget 'typename'? Note: use proper compiler next time. > Error: > > templatetest.h:13: error: type/value mismatch at argument 2 in template > parameter list for 'template<class Key, class T> class QHash' > templatetest.h:13: error: expected a type, got 'QLinkedList<V>::iterator' > templatetest.h:13: error: invalid type in declaration before ';' token > > However, if I keep the value as a QList (remove iterator) it compile fine. > > Whats the problem with storing a Iterator as the value? > > Thanks, > -mandeep > > , > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest -- Regards, Konstantin _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest