[Qt5-feedback] Lambdas

Robin Burchell viroteck at viroteck.net
Wed Jun 29 23:26:13 CEST 2011


On 29 June 2011 20:54, Thiago Macieira <thiago at kde.org> wrote:
> Em Wednesday, 29 de June de 2011, às 21:27:57, Konrad Rosenbaum escreveu:
>> if(mylist.contains( [](mydata&dat){return dat.name=="hello";} ) )
>>   doSomething()
>
> Like I said, this is a job for external functions, like qFind or STL
> algorithms.

Why? I'm not sure I agree. Qt exists to make developers' lives easier,
and even at the Qt3 -> Qt4 transition, when STL was fairly mature on
many platforms, Qt kept their own container classes (for which I am
very thankful, as they tend to provide a bit more convenience,
although a lot of that is things like implicit sharing to make writing
methods returning complex containers easier and foreach - for
instance). And isn't this exactly what things like this are about?
Convenience?

If STL provides the same functionality in its basic containers, that's
great, but we shouldn't limit ourselves to someone else's subset of
functionality, should we?


More information about the Qt5-feedback mailing list