|
Boost : |
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2002-10-05 06:01:30
Michael Stevens wrote:
>
> I have been looking at Jens's recent changes (CVS main branch) to
> random. Trying to compile under VC7 reveal a few problems
>
> 1. All cases of
> BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
> fail with for example
> error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
> with
> [
> x=false
> ]
> I suspect a problem with uint64_t or boost/limits.hpp specialisations. I
> will investigate further and try to determine what the actual type of
> IntType is in this case.
I've qualified (hopefully all) uses of BOOST_STATIC_ASSERT with
BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS. That should fix it.
Please re-test, thanks.
> 2. linear_congruential is missing a
> #include <boost/limits.hpp>
Fixed.
> 3. uniform_smallint.hpp now is defined using
>
> template<class UniformRandomNumberGenerator, class IntType = int,
> bool is_integer = std::numeric_limits<typename
> UniformRandomNumberGenerator::result_type>::is_integer>
> class uniform_smallint;
Hm... I should certainly work around (missing) partial
specialization, but I can't see how to non-clumsily work
around the fact that std::numeric_limits<> doesn't
have compile-time constants on some platforms, e.g. VC7.
Ok, I've checked in a partial solution using type_traits
for that.
Jens Maurer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk