diff options
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index 18faffb..7694e3b 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -590,6 +590,13 @@ namespace OpenVic { return callback(val); }; } + + template<typename T> + constexpr Callback<T> auto flip_height_callback(Callback<T> auto&& callback, T height) { + return [callback, height](T val) -> bool { + return callback(height - val); + }; + } } } |