Good one!
From: Pocheptsov Timur
Sent: Wednesday, November 5, 2014 4:30 PM
To: Smith Martin; Milian Wolff; Allan Sandfeld Jensen
Cc: development@qt-project.org
Subject: Re: [Development] QVector: clear while keeping capacity
v.erase(v.begin(), v.end
: Re: [Development] QVector: clear while keeping capacity
I think there should be a way to empty the vector without losing the memory. I
would have said clear() should do that, but clear() says it releases the memory.
martin
From: development-bounces
Milian Wolff
Sent: Wednesday, November 5, 2014 3:21 PM
To: Allan Sandfeld Jensen
Cc: development@qt-project.org
Subject: Re: [Development] QVector: clear while keeping capacity
On Wednesday 05 November 2014 14:33:00 Allan Sandfeld Jensen wrote:
> On Wednesday 05 November 2014, Milian Wolff wr
On Wednesday 05 November 2014 14:33:00 Allan Sandfeld Jensen wrote:
> On Wednesday 05 November 2014, Milian Wolff wrote:
> > Hello all,
> >
> > could it be that QVector changed its behavior in Qt5? I just noticed that
> > resize(0) does deallocate memory, which is highly unexpected from my side.
>
On Wednesday 05 November 2014, Milian Wolff wrote:
> Hello all,
>
> could it be that QVector changed its behavior in Qt5? I just noticed that
> resize(0) does deallocate memory, which is highly unexpected from my side.
> See e.g. this old thread where it was said to use resize(0) to clear a
> vect
Hello all,
could it be that QVector changed its behavior in Qt5? I just noticed that
resize(0) does deallocate memory, which is highly unexpected from my side. See
e.g. this old thread where it was said to use resize(0) to clear a vector
while keeping its capacity:
http://comments.gmane.org/gm