diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.hh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_base.hh b/source/blender/blenlib/BLI_math_base.hh index 3057e30dc03..b15179f75b6 100644 --- a/source/blender/blenlib/BLI_math_base.hh +++ b/source/blender/blenlib/BLI_math_base.hh @@ -44,6 +44,16 @@ template<typename T> inline T max(const T &a, const T &b) return std::max(a, b); } +template<typename T> inline void max_inplace(T &a, const T &b) +{ + a = math::max(a, b); +} + +template<typename T> inline void min_inplace(T &a, const T &b) +{ + a = math::min(a, b); +} + template<typename T> inline T clamp(const T &a, const T &min, const T &max) { return std::clamp(a, min, max); |