Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-01-02 06:14:05


> There are known ways of dealing with this problem. Putting parens around
> the min and max identifiers prevents the macro invocation. For instance,
>
> std::max( a, b ); ==> (std::max)( a, b );
>
> and
>
> struct foo { struct foo {
> int max(); ==> int (max)();
> }; };
>
> It also turns off ADL, but I'd be surprised if any code in boost relies
> on ADL with min/max.

True, but it's a horrible fix, to be blunt why should Boost authors be
forced to mangle their perfectly conforming code in order to support one
non-conforming system? If they volunteer to do so fair enough I guess...

BTW the one compiler I've had trouble with when trying to suppress macro
invocation was VC++.

> > There is BTW a trivial fix for your problem: include the windows headers
> > *before* any Boost ones.
>
> This is not a trivial fix. I'm working on a project with ~30
> sub-projects and over 5000 source files, with dozens of other
> programmers making constant changes. Ensuring that no boost header gets
> included before a windows/ATL/MFC header is a nightmare.

Fair enough, but please try the current cvs state if you can, the issue
should be fixed now.

John.


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