Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-06-19 15:24:49


On Mon, 19 Jun 2006 20:50:00 +0200, Stephan Tolksdorf
<andorxor_at_[hidden]> wrote:

>The question basically was, if the macros could be automatically
>undefined after the inclusion of the windows headers in case they
>weren't defined in beforehand (or alternatively, if NOMINMAX could be
>selectively defined for the implementation of Boost.Test).

That would of course be possible, but still not transparent. Basically
the first inclusion of windows.h for each translation unit determines
whether the min and max macros will be present. If inclusion by
unit_test.hpp is the first one then whatever it does it influences
subsequent inclusions (which are actually no-ops, due to include
guards); if it isn't the first one then the situation remains the same
automatically, for the same reason.

Microsoft's logic for the windows.h header seems to imply that it is
never included from include files. This holds every time you put
NOMINMAX, NOTHIS or NOTHAT macros in the apparent intent to give the
user more control: what results, as you can see, is no control at all.

--Gennaro.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk