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

List:       kde-devel
Subject:    Re: QStringList problem
From:       Thiago Macieira <thiago () kde ! org>
Date:       2006-11-18 9:30:46
Message-ID: 200611181030.57017.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


David Jarvie wrote:
>On Friday 17 November 2006 23:20, Thiago Macieira wrote:
>> No. All iterators are invalidated when the container is modified, both
>> in Qt3 and Qt4 (both pointer- and value-based).
>>
>> The fact that it worked before was just luck. You were relying on
>> undefined behaviour.
>
>The Qt 3.3 documentation for QValueList states "Inserting into the list
> does not invalidate any iterator." I can't find any similar statement
> in the Qt 4.2 documentation.

Hmm... you're right. In 3.3, QValueList is a linked list, so inserting 
doesn't cause reallocation of memory. In 4.x, QList isn't a pure linked 
list, so inserting may cause reallocation. QLinkedList won't be affected.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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