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:

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

Reply via email to