KDE/kdelibs/kdecore

Thiago Macieira thiago at kde.org
Tue Jul 8 14:19:57 BST 2008


Roland Harnau wrote:
>2008/7/8, Thiago Macieira <thiago at kde.org>:
>> Andreas Pakulat wrote:
>>>I'm not sure why the const_this is needed here anyway, shouldn't a
>>> simple const_iterator and ::constEnd() be sufficient too?
>>
>> It's needed because of the missing constFind() function.
>
>const_iterator QHash::constFind ( const Key & key ) const
>
>does exist, at least in Qt's API reference. I think it really improves
> readability if  the const versions (constBegin(), constEnd(),
> constFind()) are used without the need to rely on subtle rules for
> resolving overloaded methods.

Uh... you're right. It exists for QMap too.

I loaded the QList documentation, which doesn't have it. But it also 
doesn't need it because QList is based on indexes. (Hence find is 
actually "indexOf")

This code is quite clearly a direct port from Qt3, where it really didn't 
exist: http://doc.trolltech.com/3.3/qmap.html.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080708/4cf29489/attachment.sig>


More information about the kde-core-devel mailing list