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

List:       kde-core-devel
Subject:    Re: KDE/kdelibs/kdecore
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2008-07-08 7:30:14
Message-ID: 20080708073014.GA23526 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]

On 07.07.08 23:19:59, Thiago Macieira wrote:
> 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. There are two 
> overloads to find(): one non-const returning an iterator and a const 
> returning a const_iterator. The only way to select the const version (and 
> hence avoid detaching) is to have a const container.

aah, I thought the compiler was clever enough to use the const-version
when I'm doing

QHash<Foo,Bar>::const_iterator it = somemap.find();

Due to the needed const-type on the left hand side.

Andreas

-- 
Chicken Little was right.
[prev in list] [next in list] [prev in thread] [next in thread] 

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