[Interest] QVariantMap: constEnd() not equal to end()?

Aleksandr Mezin amezin at crystalnix.com
Fri Mar 20 07:25:48 CET 2015


Hi.

I have following code:

Table::const_iterator i(table.constFind(name));
if (i != table.end()) {
    ...
}

Table is a typedef for QHash<...>

This code doesn't work as I expect with Qt 5.4.1 MSVC 2013.
The "if" is never entered, even when 'name' isn't found in the table.
But it starts to work after replacing "end()" with "constEnd()".
So, I guess, end() isn't equal to constEnd()? Is it an intended behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150320/0a4e1c45/attachment.html>


More information about the Interest mailing list