[Development] QList

Konstantin Tokarev annulen at yandex.ru
Thu Mar 30 00:33:51 CEST 2017



30.03.2017, 00:17, "Philippe" <philwave at gmail.com>:
>>  I would really, really like to know why QVector is easier to use?
>
> Following common methods are immediate. With std::vector, you need to
> add boilerplate code to achieve the same.
>
> QVector::insert
> QVector::remove
> QVector::value(int i, const T &defaultValue)
> QVector::move
> QVector::contains
> QVector::operator+=(const QVector<T> &other)
>
> Not to mention the many other convenient QVector methods.
>
> And being able to use a QVector with O(1) by-value assigment, thanks to
> COW, make it easy to use QVectors "as primitive types", with no
> reasonning effort.

With move semantics you can achieve this without CoW in a more explicit way

>
> Philippe
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

-- 
Regards,
Konstantin



More information about the Development mailing list