Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-06-05 13:32:55


At 12:36 PM 6/5/00 -0500, Ed Brey wrote:

>From: "Thomas Matelich" <sosedada_at_[hidden]>
>> In MSVC 6, sp3, I'm getting an error in numeric_cast about the min
>and max
>> macro. Obviously, I need to undefine them, I was just wondering
if
>this is
>> something that should be built into config.hpp somehow?
>
>You're probably running into a problem with the MS headers (i.e.
>windows.h) defining min and max as macros. This hoses up
>std::numeric_limits and anything else that uses min and max as
>members.
>
>A workaround is to undefine min and max after you've included all
the
>windows headers. STLport provides a more elaborate workaround,
which
>is to undefine them and then define them as inline functions like MS
>should do in windows.h in the first place.
>
>In theory, we could put the appropriate detection and workaround in
>boost's config.hpp, and although I can't think of where it would go
>wrong, it just feels more intrusive and makes me a bit nervous for
>such a widespread library as boost. There would have to be a good
>deal of benefit to justify it.

It seems messy. Might conflict with homegrown solutions, too. Let's
hold off for now.

Would someone volunteer to draft a "VC++ Caveats" web page, with
fixes like this?

That way VC++ users wouldn't be completely left out to dry, yet we
wouldn't have to mess up config.hpp with a possibly ill advised fix.

--Beman


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