File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -830,12 +830,14 @@ namespace io{
830
830
struct set_to_max_on_overflow {
831
831
template <class T >
832
832
static void on_overflow (T&x){
833
- x = std::numeric_limits<T>::max ();
833
+ // using (std::numeric_limits<T>::max) instead of std::numeric_limits<T>::max
834
+ // to make code including windows.h with its max macro happy
835
+ x = (std::numeric_limits<T>::max)();
834
836
}
835
837
836
838
template <class T >
837
839
static void on_underflow (T&x){
838
- x = std::numeric_limits<T>::min ();
840
+ x = ( std::numeric_limits<T>::min) ();
839
841
}
840
842
};
841
843
@@ -964,7 +966,7 @@ namespace io{
964
966
while (*col != ' \0 ' ){
965
967
if (' 0' <= *col && *col <= ' 9' ){
966
968
T y = *col - ' 0' ;
967
- if (x > (std::numeric_limits<T>::max ()-y)/10 ){
969
+ if (x > (( std::numeric_limits<T>::max) ()-y)/10 ){
968
970
overflow_policy::on_overflow (x);
969
971
return ;
970
972
}
@@ -995,7 +997,7 @@ namespace io{
995
997
while (*col != ' \0 ' ){
996
998
if (' 0' <= *col && *col <= ' 9' ){
997
999
T y = *col - ' 0' ;
998
- if (x < (std::numeric_limits<T>::min ()+y)/10 ){
1000
+ if (x < (( std::numeric_limits<T>::min) ()+y)/10 ){
999
1001
overflow_policy::on_underflow (x);
1000
1002
return ;
1001
1003
}
You can’t perform that action at this time.
0 commit comments