[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Иван Комиссаров abbapoh at gmail.com
Mon Jul 13 16:04:44 CEST 2015


AFAIK unused methods doesn't get instantiated, am i wrong?

2015-07-13 18:09 GMT+03:00 Marc Mutz <marc.mutz at kdab.com>:

> On Monday 13 July 2015 14:42:38 Milian Wolff wrote:
> > and `strip` the binaries afterwards. So it's still ~2KB worse off - any
> > chance  for using `extern templates` or similar to reduce this code
> bloat?
>
> Might work for QList<QByteArray>, but for most types, no. Explicitly
> instantiating QList also instantiates (parts of) QVector, QSet, and
> std::list,
> by way of toSet/toVector/toStdList members (this is one of the reasons why
> you
> shouldn't add as members what you can add as non-member) which adds having
> a
> default ctor and a qHash() overload to the requirements on the type, on
> top of
> what QList requires.
>
> Not all types satisfy that, e.g. QPointF.
>
> --
> Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
> KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
> Tel: +49-30-521325470
> KDAB - The Qt Experts
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150713/7eeef20c/attachment.html>


More information about the Development mailing list