mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Use forwarding reference when passing function objects
So instead of passing every function objects by value (a copy is made), now function objects will be handled properly by reference (for lvalues) or by value (for rvalues).
This commit is contained in:
@@ -50,7 +50,7 @@ public:
|
||||
// T proxyFunc(const T &a);
|
||||
template <typename ProxyFunc>
|
||||
explicit CachedSettingValue(const char *keyName, const T &defaultValue
|
||||
, ProxyFunc proxyFunc)
|
||||
, ProxyFunc &&proxyFunc)
|
||||
: m_keyName(QLatin1String(keyName))
|
||||
, m_value(proxyFunc(loadValue(defaultValue)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user