16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 18:09:18 +02:00

Replace clamp with std::clamp

This commit is contained in:
docentYT
2026-05-01 22:14:29 +02:00
parent 1bdd000443
commit d1f16411a1
36 changed files with 271 additions and 287 deletions

View File

@@ -251,21 +251,6 @@ template <typename T> bool is_equal(T const &Left, T const &Right, T const Epsil
return (Left == Right);
}
template <typename Type_> Type_ clamp(Type_ const Value, Type_ const Min, Type_ const Max)
{
Type_ value = Value;
if (value < Min)
{
value = Min;
}
if (value > Max)
{
value = Max;
}
return value;
}
// keeps the provided value in specified range 0-Range, as if the range was circular buffer
template <typename Type_> Type_ clamp_circular(Type_ Value, Type_ const Range = static_cast<Type_>(360))
{