Is undefining "max" the only way to call numeric_limits<double>::max() in VS?
Hi,
For this fragment:
Code:
std::numeric_limits<double>::max();
MSVC gave me the error:
Quote:
1>.\dbqWrapper.cpp(109) : warning C4003: not enough actual parameters for macro 'max'
1>.\dbqWrapper.cpp(109) : error C2589: '(' : illegal token on right side of '::'
1>.\dbqWrapper.cpp(109) : error C2059: syntax error : '::'
It took me one hour and probably one pund of my body fat to finally try
Code:
#undef max
std::numeric_limits<double>::max();
with success.
I was not aware of the fact that the preprocessor is cabable to overwrite function names from inside the STL.
Is the #undef max the standard way of dealing with that or how do you do it?
Thank you!