[Development] implicit sharing and iterators in qt containers

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Jul 31 19:11:02 CEST 2017


>
>
> Your OrderedMap should itself be implicitly shared and clone the linked
> list
> on detach.
>

Right now, I'm detaching the linked list during copy-construction (and
assignment). Detaching here means re-populating the LL with same entries
and then storing the new LL iterator's in the hash.

For implicit sharing, I'll have to this instead when a non-const function
is called for the first time on the copy. This will cause a penalty when
calling such a function as the hash has to be repopulated with all entries
(eg: calling remove on the copy will take linear time instead of constant,
although subsequent calls will have no penalty). Still thinking about it.

Thanks for your input.

-mandeep



>         Kevin Kofler
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170731/2a3f2296/attachment.html>


More information about the Development mailing list