[Qt5-feedback] Why lambdas would be very good to have
Charley Bay
charleyb123 at gmail.com
Sun Jun 12 14:40:13 CEST 2011
Timur spaketh:
> There was an initiative I've seen in
> http://labs.qt.nokia.com/2011/05/26/cpp0x-in-qt/ that Qt intends to
> support features included in C++0x, including lambdas. <snip>
> I have implemented a class that provides a simplistic implementation of
> the above and put together a small example code to demonstrate how it
> works.
> http://pastebin.com/tZdkJQCd
> http://pastebin.com/WiC6MTNn
> I think a similar class (or the implementation of these methods in QList
> itself) could be a reasonable improvement in Qt.
>
> The other area where I would love to see lambdas is signal-slot
> connections <snip>
I'm curious, what do you guys think about these?
> As for me, I'd love to see these feature in Qt 5.
>
+1
(1) Lambdas for signal/slot
(2) Lambdas for LINQ-like set filtering
(3) ???
(4) Profit!
I like that your "Queryable" example explicitly handles "Zero-Or-One" and
"Zero-Or-Many" (IMHO explicit both are required).
I also have implemented my own version of "lambdas" with Functors, and it
works nicely. For the trivial stuff, lambdas would probably be easier; for
the "heavy" stuff, Functors are probably better.
--charley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt5-feedback/attachments/20110612/96704395/attachment.html
More information about the Qt5-feedback
mailing list