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 ma
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 would an rvalue overloa
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 functions like
> > operat
>
>
> inline QVector &operator+=(T &&t)
> { append(std::move(t)); return *this; }
>
Ah, yes! This makes sense.
inline QVector &operator<< (T &&t)
> { append(std::move(t)); return *this; }
>
> Note they might be missing from qvarlengtharray too.
>
Thanks for the clarification.
-mandeep
>
> 'Al
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 an
Am 03.03.2018 um 21:25 schrieb 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 c
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 you