mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
fix(VarHolder): limits check
This commit is contained in:
parent
309aff3579
commit
c37780726d
@ -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.");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user