diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-23 19:47:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-23 19:47:47 +0200 |
commit | 6cd55c452d1643666ff4169a89402fd3e3b66c61 (patch) | |
tree | 888b847a54c66b6e9d1b2f7ee3e3d0f8071eceda /src/openvic-simulation/dataloader | |
parent | 9d57ca273e4b32ab82a51789ec58e08fefb5276a (diff) | |
parent | 67cbd14630c4344902d3fa1ddca178809da4293b (diff) |
Merge pull request #177 from OpenVicProject/country-instance
Fleshing out Country, State and Province instances + history
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index 18faffb..d019cce 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -12,7 +12,6 @@ #include "openvic-simulation/types/Colour.hpp" #include "openvic-simulation/types/Date.hpp" -#include "openvic-simulation/types/HasIdentifier.hpp" #include "openvic-simulation/types/IndexedMap.hpp" #include "openvic-simulation/types/OrderedContainers.hpp" #include "openvic-simulation/types/Vector.hpp" @@ -528,7 +527,7 @@ namespace OpenVic { }; } - template<std::derived_from<HasIdentifier> T, typename... SetArgs> + template<typename 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) { @@ -539,7 +538,7 @@ namespace OpenVic { }; } - template<std::derived_from<HasIdentifier> Key, typename Value, typename... MapArgs> + template<typename Key, typename Value, typename... MapArgs> Callback<Value> auto map_callback( tsl::ordered_map<Key const*, Value, MapArgs...>& map, Key const* key, bool warn = false ) { @@ -561,7 +560,7 @@ namespace OpenVic { Logger::error("Null key in map_callback"); return false; } - Value& map_value = map[*key]; + typename IndexedMap<Key, Value>::value_ref_t map_value = map[*key]; bool ret = true; if (map_value != Value {}) { Logger::warn_or_error(warn, "Duplicate map entry with key: \"", key, "\""); |