mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07: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:
parent
6738cdd715
commit
c75500670d
2 changed files with 3 additions and 3 deletions
|
@ -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)))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue