[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 150931] need to remove remaining uses of Qt3Support container
From:       Maksim Orlovich <maksim () kde ! org>
Date:       2007-10-19 15:08:00
Message-ID: 20071019150800.31325.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=150931         




------- Additional Comments From maksim kde org  2007-10-19 17:07 -------
That's pretty fundamental functionality, so I would be really surprised if it didn't \
work. Have you tried valgrind? You may need to export KDE_DEBUG=1 (and a lot of \
patience) to run testregression in it, though. Plus, the code looks fine:

template <class Key, class T>
Q_INLINE_TEMPLATE const T QHash<Key, T>::value(const Key &akey) const
{
    Node *node;
    if (d->size == 0 || (node = *findNode(akey)) == e) {
        return T();
    } else {
        return node->value;
    }
}

(there is also http://doc.trolltech.com/4.3/qhash.html#value-2...)

Try this if you're not convinced:
#include <iostream>

template<typename T>
T make()
{
    return T();
}

int main()
{
    std::cout << make<int*>() << "\n";
}

Your second assert looks dubious, though, you're doing \
!counters->find(counter).value() when counters does not contain counter. Then the \
iterator for counters->find(counter) is the end iterator, so it can't be deref'd, I \
would think.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic