30.03.2017, 00:17, "Philippe" <[email protected]>: >> 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 > [email protected] > http://lists.qt-project.org/mailman/listinfo/development -- Regards, Konstantin _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
