diff options
author | hop311 <hop3114@gmail.com> | 2024-01-22 20:17:38 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-22 20:25:09 +0100 |
commit | caa2f31d536f568e485f15537db5e2f79f7616d5 (patch) | |
tree | 7cd8a379963af18c24f8dabfe7525b39f2333e0c /src/openvic-simulation/dataloader/NodeTools.hpp | |
parent | 8205732a1b95f018f0898a2a4bc62e22f5bee0d3 (diff) |
Miscellaneous bug fixes and format cleanupmisc-changes
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index 4b33c6d..0845e6c 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -357,17 +357,17 @@ namespace OpenVic { } template<typename... Args> - bool warn_or_error(bool warn, Args... args) { + bool warn_or_error(bool warn, Args&&... args) { if (warn) { - Logger::warning(args...); + Logger::warning(std::forward<Args>(args)...); return true; } else { - Logger::error(args...); + Logger::error(std::forward<Args>(args)...); return false; } } - template<typename T, typename U, typename...SetArgs> + template<typename T, typename U, typename... SetArgs> Callback<T> auto set_callback(tsl::ordered_set<U, SetArgs...>& set, bool warn = false) { return [&set, warn](T val) -> bool { if (set.emplace(std::move(val)).second) { @@ -377,7 +377,7 @@ namespace OpenVic { }; } - template<std::derived_from<HasIdentifier> T, typename...SetArgs> + template<std::derived_from<HasIdentifier> T, typename... SetArgs> Callback<T const&> auto set_callback_pointer(tsl::ordered_set<T const*, SetArgs...>& set, bool warn = false) { return [&set, warn](T const& val) -> bool { if (set.emplace(&val).second) { |