Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2004-06-03 12:35:05


Rozental, Gennadiy wrote:
>>As shown in http://tinyurl.com/3xdyq,
>>Boost.Test fails to build on gcc 2.95 with stlport. The error
>>message is:
>>
>> /boost/head-regression/boost/boost/minmax.hpp: In function
>>`const size_t & boost::std_min<size_t>(const size_t &, const
>>size_t &)':
>>
>>/boost/head-regression/boost/libs/test/build/../src/test_tools
>>.cpp:375: instantiated from here
>> /boost/head-regression/boost/boost/minmax.hpp:26: `min'
>>undeclared (first use this function)
>>
>>Is it possible that authors of either Boost.Test or
>>boost/minmax.hpp take care of this error?
>
>
> I'd prefer it to be addressed on minmax.hpp level. After all it's the header
> responsible for min and max.

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);

in boost/minmax.hpp. (This would, of course, break
other compilers/libraries) gcc-2.95.3 without STLPort
doesn't require that change, but works fine with it, too.

Regards,
m


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