In a source code, I saw that min and max were being undefined. What could be the reason for that?
// remove stupid MSVC min/max macro definitions
#ifdef WIN32
#undef min
#undef max
#endif
Some MSVC header has pre-processor macros to define min
and max
. This is bad for many reasons. First, they are not reserved names, second, there are standard library functions with the same names.
So MSVC or whatever was breaking the rules and code by defining min
and max
as macros, and the use of undef
is a work-around to fix that problem.
See this related question, which shows how the defines can break code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With