fix(VarHolder): limits check

This commit is contained in:
Alex Fabijanic 2022-06-27 13:33:10 +02:00
parent 309aff3579
commit c37780726d

View File

@ -410,16 +410,15 @@ private:
template <typename F, typename T>
void checkUpperLimit(const F& from) const
{
if ((sizeof(T) < sizeof(F)) &&
(from > static_cast<F>(std::numeric_limits<T>::max())))
{
throw RangeException("Value too large.");
}
else
if (from > std::numeric_limits<T>::max())
{
throw RangeException("Value too large.");
}
}
template <typename F, typename T>
void checkLowerLimit(const F& from) const
{
if (from < std::numeric_limits<T>::min())
throw RangeException("Value too small.");
}
template <typename F, typename T>
@ -453,13 +452,6 @@ private:
throw RangeException("Value too small.");
}
}
template <typename F, typename T>
void checkLowerLimit(const F& from) const
{
if (from < std::numeric_limits<T>::min())
throw RangeException("Value too small.");
}
};