diff options
author | hop311 <hop3114@gmail.com> | 2023-11-06 21:39:40 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-11-07 19:35:38 +0100 |
commit | d30421fa7d7f6ad87d3f90cc0ab491742f0d2548 (patch) | |
tree | 601591215af0c6724766019ebb577141ea5807c5 /src/openvic-simulation/dataloader/NodeTools.hpp | |
parent | b5bbeb47febc823517a5baba4eca66f32fb3609c (diff) |
History loading generalisation
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index 4d56488..a23fb4f 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -4,6 +4,7 @@ #include <cstdint> #include <functional> #include <map> +#include <optional> #include <set> #include <type_traits> @@ -310,5 +311,13 @@ namespace OpenVic { return true; }; } + + template<typename T> + Callback<T const&> auto assign_variable_callback_pointer(std::optional<T const*>& var) { + return [&var](T const& val) -> bool { + var = &val; + return true; + }; + } } } |