
Gennadiy Rozental wrote:
"Jonathan Turkanis" :
Gennadiy Rozental wrote:
Do you have any idea why Borland fail to find rand()?
Yes. For some reason I couldn't figure it out before. The implementation of random shuffle makes an unqualified call to rand, but rand is actually in
Doesn't random shuffle is also in namespace std? Why would it fail to resolve symbol from the same namespace?
Good point. I did some poking around, and what seems to be happening is that random_shuffle is defined in namespace _STL but is brought into namespace std by a using directive: namespace std { using namespace _STLPORT_STD } where _STLPORT_STD is #define'd as _STL. I might be wrong, becasue I'm unfamiliar with the structure of the STLPort source, but it looks like this is what is happening. It thefore looks like the problem is an incompatibility between STLPort 4.5 and the Borland C runtime library.
namespace std. The iostream tests compile correctly if I add the following to unit_test_suite.ipp, after the final include directive: #if BOOST_WORKAROUND(__BORLANDC__, < 0x600) && \ BOOST_WORKAROUND(_STLPORT_VERSION, <= 0x450) \ /**/ using std::rand; #endif
Does above mean that the same isuue is with STLPort before version 4.5.0?
I'm not sure, but I don't know the exact versions of STLPort which have shipped with Borland 5.x.
Should I commit?
Ok.
All right, done.
Jonathan