Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-05-20 06:17:04


> 'std::numeric_limits<`template-parameter258'>::is_integer' : illegal use
of
> this type as an expression
> c:\dev\include\boost\random\uniform_01.hpp(95) : see reference to
> class template instantiation
> 'boost::uniform_01<UniformRandomNumberGenerator,RealType>' being compiled
>
> The problem is that although random.hpp includes limits.hpp from boost and
> limits.hpp
> includes boost/detail/limits.hpp only if BOOST_NO_LIMITS is defined.
> Wouldn't it be good to add BOOST_NO_LIMITS to either
> - config
> - the random library
>
> I understand that the user should (maybe) decide about using
> BOOST_NO_LIMITS, however,
> the user also wants random.hpp compiling "out-of-box".
> Maybe, should add BOOST_NO_LIMITS_ASWORKAROUND
> and limits.hpp should also check this and if defined include
> boost/detail/limits.hpp.
> Well, this could cause other problems if the user inadvertantly(:))
includes
> <limits> in the same compilation unit.
> But then at least the user would face the real problem and could decide
what
> to do.
> (Maybe some documentation of this would also be useful e.g. documenting
what
> libs workarounds that incluences the files the user can include.

I don't think that that would work: boost/limits.hpp defines
std::numeric_limits and there can only be one definition of that.

In any case the problem is down to the way in which vc6 handles integral
constant expressions, rather than the way in which numeric_limits is defined
for vc6. We already have a macro to handle this:
BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS, we just need to make random honor
the macro.

John.


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