Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-06-21 13:49:11


Martin Wille wrote:
>
> I tested the problem with this simple snippet:
>
> #include <boost/minmax.hpp>
> int foo() { return boost::std_min(3, 4); }
>
> The error goes away when I replace
>
> using std::min;
> return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b );
>
> by
>
> return std::min(a, b);
>

The problem with the above is that it is not semantically equivalent.
The first does argument-dependent lookup, the second does not.

I'll be ripping out std_min/std_max in the next few days, but I'll
essentially be replacing it with:
   using std::min;
   return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b );

everywhere. gcc-2.95/STLPort will not be happy with this, I assume. I
don't have this platform to test on. I need to understand what the
problem is so I can work around it.

Can someone with access to this platform tell me what the problem is? Is
min/max not in the std:: namespace? What is the issue, exactly?

Thanks.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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