Refactor to allow MSVC without #define NOMINMAX (#905)

This commit is contained in:
Dekken 2020-06-28 03:28:24 +02:00 committed by GitHub
parent 97d1ae547c
commit 27d8a0e302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}