Hi All,

 

I was reporting recently that random does not compile on msvc 6; I've seen another report on the list that it does not work on intel c 7 as well.

The fact that released random library fails to work on these very popular compilers is rather sad. I did some investigation and nailed down the problem to following simple example:

 

template <class U, class T>

class Works

{

            BOOST_STATIC_ASSERT(!std::numeric_limits<U>::is_integer);

};

 

template <class U, class T>

class Fails

{

            BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_integer);

};

 

The interesting part that it fails to compile even when there is no instantiation of the template.

 

In random library this assertion is within #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS #endif directives.

 

I did a quick search through boost sources and found somewhat similar code in numeric_traits.hpp, however not a single trick borrowed from there seemed to work in this case. Should we just disable the assertion for this particular compiler? Replacing #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS with #if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) && !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300) will solve the compile error. Is this trttd? If there are no objections, I can make this changes and send patches to someone willing to apply it to CVS.

 

Thorsten, was the error you observed on intel 7 related to this one?

__________

Kirill Lapshin