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
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
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
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
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
>
>
> 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
>
>
>
>
>