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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -