What about conditionally defining NO_MIN_MAX before each #include of <windows.h>?Originally Posted by cpjust
What about conditionally defining NO_MIN_MAX before each #include of <windows.h>?Originally Posted by cpjust
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
i even dont know what NO_MIN_MAX is!
i gotta learn this too....
thanks for telling me!
Are there other macros in <windows.h> that conflict with functions other than min & max? If so, are there #defines for them as well? Is there a list of all the macros you can define to undefine the bad macros?
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
Ugh! Too many if you are unlucky enough.
The trick is to always include windows.h last. Most headers have the needed code already to fix the conflicts. This is true of windows own headers (winsock2.h for instance which has a series of conflicts with windows.h because someone though it would be important for windows.h to include winsock.h) and third-party libraries which have more experience about it than Microsoft itself.
min-max type of conflict is one of a kind however. At least to my knowledge there's no other conflict with std:: names.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.