avoid clang tidy warning (#3646)

This commit is contained in:
JackyWoo
2022-06-27 14:57:20 +08:00
committed by GitHub
parent a785705a5c
commit b23488d6fe

View File

@@ -416,7 +416,7 @@ private:
throw RangeException("Value too large.");
}
else
if (from > std::numeric_limits<T>::max())
if (from > static_cast<F>(std::numeric_limits<T>::max()))
{
throw RangeException("Value too large.");
}
@@ -457,7 +457,7 @@ private:
template <typename F, typename T>
void checkLowerLimit(const F& from) const
{
if (from < std::numeric_limits<T>::min())
if (from < static_cast<F>(std::numeric_limits<T>::min()))
throw RangeException("Value too small.");
}
};