RE: Some trouble with qldefines.hpp
Posted by Jens Thiel on Nov 02, 2001; 3:39am
URL: http://quantlib.414.s1.nabble.com/Some-trouble-with-qldefines-hpp-tp1787p1790.html
> -----Original Message-----
> From: Nicolas Di Césaré
>
> Do you know if WinDef.h is included somewhere in standart C++ headers?
> because I don't include that file :-(
>
it is usually included indirectly by windows.h and others.
> I add NOMINMAX in the preprocessor definitions and it works fine
> if I redefine min/max functions.
>
> I think that the 1st solution is better because we just have to change
> qldefines.hpp file. With the second one, we have to define
> NOMINMAX in each new project.
>
Since defining min()/max() macros is wrong (should have been _min or MIN if
any), I think it's best to turn it off completely and replace it with
template functions. That way it should not break anything (and if something
breaks there will be some very good reason...). Thats why M$ added NOMINMAX.
Of course, using (min)() prevents macro expansion, so you can go with that,
if you are sure that you (and all of your colleagues now and forever) will
use (min)() properly...
> Do you have another idea?
>
Why not having a site specific include file that you will use in all of your
projects?
Regards,
Jens.
--
/* Jens Thiel * Stochastix GmbH, Germany * +49-700-STOCHASTIX */