Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-09-20 05:25:09

>BTW2, random.hpp uses the ULL suffix. Since its non-standard, I'd
>prefer the constant be replaced with the uint64_t(123) style,
>assuming that it's OK.

I don't think that it is, or at least it depends :-)

If the constant is expressable as an int then it's OK - it will just get
promoted to the actual type.
However if the constant is long or long long, then the compiler is entitled
to choke:

uint64_t i = uint64_t(0x8000000000000000); // error: constant is not an

However in the case of the random library, I think that something like 1uLL
<< 63 is used, in which case this could be replaced by: int64_t(1) << 63.

>BTW3, random.hpp also uses the macro BOOST_STDINT_H_HAS_UINT64_T,
>which isn't defined anywhere. It should be changed to use
>BOOST_NO_INT64_T. Note, however, that this would cause VC to try to
>compile rand48, which still doesn't work, because, for one reason,
>the enum hack doesn't scale to 64-bits. Putting this all together,
>random.hpp should really use the following guard

Pitty about VC6, same problem with Borland C++, it complains that the
int64_t template argument is not an integer constant expression! There may
be a workaround, but I haven't really had the time to try.

- John.

Boost list run by bdawes at, gregod at, cpdaniel at, john at