make clamp use TypeIdentityType so the min and max values dont participate in type deduction

This commit is contained in:
HJfod 2024-02-14 14:14:02 +02:00
parent 077ead1428
commit 4ba0b7d58d

View file

@ -68,7 +68,7 @@ namespace geode {
}
template <typename T>
constexpr const T& clamp(const T& value, const T& minValue, const T& maxValue) {
constexpr const T& clamp(const T& value, const TypeIdentityType<T>& minValue, const TypeIdentityType<T>& maxValue) {
return value < minValue ? minValue : maxValue < value ? maxValue : value;
}