BLI: add min_inplace and max_inplace functions

This commit is contained in:
Jacques Lucke 2022-06-20 16:22:04 +02:00
parent 06b212c446
commit af983a3eef
1 changed files with 10 additions and 0 deletions

View File

@ -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);