refactor to allow MSVC without #define NOMINMAX

This commit is contained in:
dekken 2020-06-25 23:04:26 +02:00
parent 97d1ae547c
commit b7241f45c3

View File

@ -120,8 +120,8 @@ typename std::enable_if<(std::is_same<T, unsigned char>::value ||
ConvertStreamTo(std::stringstream& stream, T& rhs) {
int num;
if ((stream >> std::noskipws >> num) && (stream >> std::ws).eof()) {
if (num >= std::numeric_limits<T>::min() &&
num <= std::numeric_limits<T>::max()) {
if (num >= (std::numeric_limits<T>::min)() &&
num <= (std::numeric_limits<T>::max)()) {
rhs = num;
return true;
}