aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-31 02:11:47 +0100
committer hop311 <hop3114@gmail.com>2023-11-07 19:33:42 +0100
commitc1b7cab254ac14a173477661047ad2492930ff8b (patch)
tree3fd965559fb97c7a2f2245952ab531afec84bc93 /src/openvic-simulation/dataloader/NodeTools.hpp
parente91ce707b2c0e80591b9fd1b6a5215e6e6989df8 (diff)
History loading changes + PROPERTY macro
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index 798976f..4d56488 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -66,7 +66,7 @@ namespace OpenVic {
}
node_callback_t expect_identifier(callback_t<std::string_view> callback);
- node_callback_t expect_string(callback_t<std::string_view> callback, bool allow_empty = true);
+ node_callback_t expect_string(callback_t<std::string_view> callback, bool allow_empty = false);
node_callback_t expect_identifier_or_string(callback_t<std::string_view> callback, bool allow_empty = false);
node_callback_t expect_bool(callback_t<bool> callback);
@@ -261,15 +261,8 @@ namespace OpenVic {
};
}
- template<std::integral T>
- callback_t<T> assign_variable_callback_cast(auto& var) {
- return [&var](T val) -> bool {
- var = val;
- return true;
- };
- }
-
- template<std::signed_integral T>
+ template<typename T>
+ requires std::is_integral_v<T> || std::is_enum_v<T>
callback_t<T> assign_variable_callback_cast(auto& var) {
return [&var](T val) -> bool {
var = val;