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

List:       kde-core-devel
Subject:    Re: KDE/kdelibs/kdecore
From:       Thiago Macieira <thiago () kde ! org>
Date:       2008-07-08 13:19:57
Message-ID: 200807081019.57318.thiago () kde ! org
[Download RAW message or body]


Roland Harnau wrote:
>2008/7/8, Thiago Macieira <thiago@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

["signature.asc" (application/pgp-signature)]

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

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