[Development] Proposal: Deprecating platforms in Qt 5.6 that don't support lambda
Marc Mutz
marc.mutz at kdab.com
Fri Feb 20 09:51:59 CET 2015
On Thursday 19 February 2015 21:41:42 Matthew Woehlke wrote:
> connect(d->UI.scrollBar, &QAbstractSlider::valueChanged,
> [d](int value){ d->scrollTo(value); });
Indeed, I hadn't thought of private slots. Thanks for the reeducation.
Just make sure - and that's a big part of what I was trying to refer to - that
you don't use that statment in more than one function. Because identical
lambdas in different functions have different types, and thus templates they are
passed to are instantiated anew each time. And compilers don't merge identical
executable code from different template instantiations (or do they)?
Cf. the commits that confine QStringLiteral to static inline functions to avoid
duplicating the QString array data for each use in a different function.
Thanks,
Marc
--
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
More information about the Development
mailing list