diff --git a/src/base/algorithm.h b/src/base/algorithm.h index 01aa39324..6eb9089b6 100644 --- a/src/base/algorithm.h +++ b/src/base/algorithm.h @@ -50,7 +50,7 @@ namespace Algorithm // To be used with associative array types, such as QMap, QHash and it's variants template ::value, int> = 0> - void removeIf(T &dict, BinaryPredicate p) + void removeIf(T &dict, BinaryPredicate &&p) { auto it = dict.begin(); while (it != dict.end()) @@ -60,7 +60,7 @@ namespace Algorithm // To be used with set types, such as QSet, std::set template ::value, int> = 0> - void removeIf(T &set, UnaryPredicate p) + void removeIf(T &set, UnaryPredicate &&p) { auto it = set.begin(); while (it != set.end()) diff --git a/src/base/settingvalue.h b/src/base/settingvalue.h index b2d13b353..64998e2d4 100644 --- a/src/base/settingvalue.h +++ b/src/base/settingvalue.h @@ -50,7 +50,7 @@ public: // T proxyFunc(const T &a); template explicit CachedSettingValue(const char *keyName, const T &defaultValue - , ProxyFunc proxyFunc) + , ProxyFunc &&proxyFunc) : m_keyName(QLatin1String(keyName)) , m_value(proxyFunc(loadValue(defaultValue))) {