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 d019cce..945e5e8 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -589,6 +589,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); + }; + } } } |