[Development] QVector rvalue overloads for convenience functions?

2018-03-03 Thread Christian Ehrlicher
Hi, recently rvalue overloads for QVector::append(T), push_back(T) and others were added to QVector. But not for the convenience functions like operator<<(T) or operator +=(T). Is this an oversight or by intention? Thx, Christian ___ Development

Re: [Development] QVector rvalue overloads for convenience functions?

2018-03-03 Thread Mandeep Sandhu
On Sat, Mar 3, 2018 at 11:46 AM, Christian Ehrlicher wrote: > Hi, > > recently rvalue overloads for QVector::append(T), push_back(T) and others > were added to QVector. But not for the convenience functions like > operator<<(T) or operator +=(T). Is this an oversight Why

Re: [Development] QVector rvalue overloads for convenience functions?

2018-03-03 Thread Allan Sandfeld Jensen
On Samstag, 3. März 2018 21:11:18 CET Mandeep Sandhu wrote: > On Sat, Mar 3, 2018 at 11:46 AM, Christian Ehrlicher > > wrote: > > Hi, > > > > recently rvalue overloads for QVector::append(T), push_back(T) and others > > were added to QVector. But not for the convenience

[Development] QVector reserve counterproductive?

2018-03-03 Thread Christian Ehrlicher
Hi, while digging through the bugreports I found https://bugreports.qt.io/browse/QTBUG-66677 which seems to show a downside of QVector::reserve(). QPainterPath::addPolygon() is calling reserve() to make sure to have enough space for the new positions. This is exactly what I would have done

Re: [Development] QVector reserve counterproductive?

2018-03-03 Thread Martins , Sérgio
On 2018-03-03 20:38, Christian Ehrlicher wrote: Hi, while digging through the bugreports I found https://bugreports.qt.io/browse/QTBUG-66677 which seems to show a downside of QVector::reserve(). Yes, reserve() shouldn't be called repeatedly inside loops. Instead use it only once, outside

Re: [Development] QVector rvalue overloads for convenience functions?

2018-03-03 Thread Mandeep Sandhu
> > > inline QVector +=(T &) > { append(std::move(t)); return *this; } > Ah, yes! This makes sense. inline QVector << (T &) > { append(std::move(t)); return *this; } > > Note they might be missing from qvarlengtharray too. > Thanks for the clarification. -mandeep > > 'Allan > > > > >