Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-06-26 08:39:20

"Gennaro Prota" wrote
> On Mon, 26 Jun 2006 11:58:30 +0100, "Martin Bonner"
> <martin.bonner_at_[hidden]> wrote:
>>The basic rule is that you must never have the (pp-)tokens "max" and "("
>>one after the other.
> Yes.
>>If you do, the preprocessor will try to expand the
>>max macro.
>>The solution is to wrap the function name in parens
> It's not the only solution, fortunately (the parentheses in general
> also prevent ADL). You can use anything different than an open paren
> which doesn't change the meaning of the construct after the
> preprocessing phase. For instance:
> return [std::]numeric_limits<double>::max
> Of course that's exactly what BOOST_PREVENT_MACRO_SUBSTITUTION is for.
> FWIW, I would prefer for it to be named something like
> BOOST_GUARD_FROM_FUNCTION_LIKE_MACRO, as it does not apply to
> object-like macros.

Ahh that works! :
#include <windows.h>
#include <boost/config.hpp>
struct my{
    typedef int min;

int main()


Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at