diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-21 14:45:50 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-21 14:07:46 +0000 |
commit | 1ffd78bbf508df3c5ee8adf7fc6b7b5439a8454e (patch) | |
tree | 1535e91cf752eb1cc4b4b4b0be882f500e424646 | |
parent | a0269d8b27cbad6925549b84ccfef24fd7e1ffc3 (diff) | |
download | qt-creator-1ffd78bbf508df3c5ee8adf7fc6b7b5439a8454e.tar.gz |
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: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r-- | src/libs/utils/algorithm.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index 905a70b232..9b4a5752f0 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -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); |