[Development] QList
Ville Voutilainen
ville.voutilainen at gmail.com
Wed Mar 29 15:09:07 CEST 2017
On 29 March 2017 at 15:53, Olivier Goffart <olivier at woboq.com> wrote:
> On Mittwoch, 29. März 2017 13:33:12 CEST Philippe wrote:
>> On Wed, 29 Mar 2017 10:39:42 +0200
>>
>> Olivier Goffart <olivier at woboq.com> wrote:
>> > I don't think we need QArrayList. As you said, it's not often used (only
>> > one known use?). and QToolBox is not even using the implicit sharing, so
>> > it could easily be ported so std::vector<std::unique_ptr<.>>
>>
>> When you need an index-based container, to insert and sort many big
>> objects, a QList like container is ideal.
>> Easier than std::vector<std::unique_ptr<.>> and with the benefit of cow.
>
> COW does not make much sense for a "QArrayList", as a detach would suddenly
> copy all the elements and break the references.
> (And QToolBox for example don't share its internal list)
Ha, good point - reference stability and CoW don't seem to mix. That
leaves the question
whether we want guaranteed indirect storage and an indexing api. Which
is something
like a std::vector<std::some_fine_day::cloned_ptr<T>>.
More information about the Development
mailing list