aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-21 15:09:25 +0200
committer hop311 <hop3114@gmail.com>2024-07-22 20:21:27 +0200
commit67cbd14630c4344902d3fa1ddca178809da4293b (patch)
tree9df96829dd0f9a0bd7c2e6b0e047547aa4bff3a7 /src/openvic-simulation/dataloader
parentd1f3a96b72dd06b5f97dd4643e5f016a02b42ea6 (diff)
Fleshing out Country, State and Province instances + historycountry-instance
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp7
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, "\"");