Boost logo

Boost :

From: Dave Harris (brangdon_at_[hidden])
Date: 2004-01-05 10:38:13


In-Reply-To: <020401c3d126$c6d89130$b9510352_at_fuji>
john_at_[hidden] (John Maddock) wrote (abridged):
> > 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)();
> > }; };
>
> True, but it's a horrible fix [...]

In my own Windows code I avoid the names min and max altogether. Would it
be feasible to add a boost::Min and boost::Max ? That is, are there any
situations like the struct foo where max is part of the published boost
API?

Are there any other "known ways" which should be considered before
updating the boost source?

-- Dave Harris, Nottingham, UK


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