c++ - Undefining min and max macros -


in source code, saw min , max being undefined. reason that?

// remove stupid msvc min/max macro definitions #ifdef win32    #undef min    #undef max #endif 

some msvc header has pre-processor macros define min , max. bad many reasons. first, not reserved names, second, there standard library functions same names.

so msvc or whatever breaking rules , code defining min , max macros, , use of undef work-around fix problem.

see this related question, shows how defines can break code.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -