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

André Somers andre at familiesomers.nl
Fri Jul 17 14:13:28 CEST 2015


Mark Gaiser schreef op 17-7-2015 om 13:44:
>
> You can use std::find_if for that on any container.
> Works for C++11 and even before that. C++11 gives the benefit of using 
> a lambda in the std::find_if UnaryPredicate.
Sure, but wouldn't that revert you back to a linear search? That sounds 
like getting the worst of both worlds: using a complicated red/black 
tree data structure and then iterating over it lineary to find an item 
that I could have found using the structure itself in logarithmic 
time... Or am I overlooking some very clever specialization in the 
find_if algorithm then?

André




More information about the Development mailing list