Skip to content

Commit

Permalink
refactor to allow MSVC without #define NOMINMAX
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Jun 25, 2020
1 parent 97d1ae5 commit 5863e9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/yaml-cpp/node/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,16 @@ 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;
}
}
return false;
}


template <typename T>
typename std::enable_if<!(std::is_same<T, unsigned char>::value ||
std::is_same<T, signed char>::value), bool>::type
Expand Down

0 comments on commit 5863e9b

Please sign in to comment.