On sexta-feira, 30 de março de 2012 18.41.46, Olivier Goffart wrote: > On Friday 30 March 2012 12:23:59 Thiago Macieira wrote: > > Use of QVarLengthArray should *only* be done with primitive types, the > > fixes applied to it during Qt 4.x lifetime notwithstanding. So the user > > must know that before he uses that class. If he's not sure, use QVector. > > That is wrong. QVarLenghtArray can be use with every types.
That statement ^^^
> > Also, QVarLengthArray should zero-initialise, but it doesn't.
>
> It is documented not to.
And this statement ^^^
Are in contradiction. If it doesn't zero-initialise, then it doesn't
initialise. Then using it for non-PODs is dangerous.
If it supports any type, then it must initialise them all.
> But yes, it probably should. (we can add a Qt::Uninitialized overload if we
> need it)
I'd rather we removed support for non-primitives. The class wasn't designed
for that.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
