Commit 1ffd78bb authored by Tobias Hunger's avatar Tobias Hunger

Algorithm: Make transform work with simple iterators

Do not require containers to provide a size() method. This
makes for a less optimized insertion into the target container,
but most Qt classes should still handle this ok.

The upside is that e.g. the treemodel iterators can now be
transformed.

Change-Id: I4f149720631d9efb7b787332f039074b4c796965
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent a0269d8b
......@@ -263,7 +263,6 @@ struct TransformImpl {
static C call(const SC &container, F function)
{
C result;
result.reserve(container.size());
std::transform(container.begin(), container.end(),
inserter(result),
function);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment