On Tuesday 21 July 2015 11:23:26 Allan Sandfeld Jensen wrote: > On Monday 20 July 2015, Marc Mutz wrote: > > https://codereview.qt-project.org/121810 > > > > So start using qMove() or pass temporaries in your QVector::append() > > calls. > > Are we also using move internally when resizing and detaching?
No. For detach, we cannot (we need a copy). For resize, the pressure to implement it isn't very big, because most types that have a move ctor can also be Q_MOVABLE_TYPE (or, soon, Q_RELOCATABLE_TYPE, ie. Q_MOVABLE_TYPE, except for QList), and just realloc() is still faster calling lots of move ctors + dtors. If you have a move-only type, or a type that can be moved but cannot be Q_MOVABLE_TYPE (and not just because of QList BiC, which Q_RELOCATABLE_TYPE will fix), better use std::vector to hold it. Thanks, Marc -- Marc Mutz <[email protected]> | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company Tel: +49-30-521325470 KDAB - The Qt Experts _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
