diff options
author | crupest <crupest@outlook.com> | 2018-11-09 22:59:38 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-11-09 22:59:38 +0800 |
commit | ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9 (patch) | |
tree | e5b886f1884fa56dd90059523b1f4dc730bb5003 /src/any_map.h | |
parent | 4b219b569c16db6027dd36e4656152f261321c60 (diff) | |
download | cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.gz cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.bz2 cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.zip |
Add predefine resource.
Diffstat (limited to 'src/any_map.h')
-rw-r--r-- | src/any_map.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/any_map.h b/src/any_map.h index 2dee75a6..ea6044b1 100644 --- a/src/any_map.h +++ b/src/any_map.h @@ -67,10 +67,10 @@ namespace cru // Set the value of key, and trigger all related listeners. template <typename T> - void SetValue(const String& key, const T& value) + void SetValue(const String& key, T&& value) { auto& p = map_[key]; - p.first = std::make_any<T>(value); + p.first = std::make_any<T>(std::forward<T>(value)); InvokeListeners(p.second, p.first); } |