integer constant too large for 'long' type

I'm having problems compiling this line of code on a 32bit system: boost::uniform_int<uint64_t> r(0,0xffffffffffffffff); compile-time error: "integer constant too large for 'long' type" compiled fine on my 64 bit machine. Also sizeof(uint64_t) on both machines is correct at 8 bytes (typedef'd as long long int on the 32bit machine). Any ideas?

Isn't it : boost::uniform_int<uint64_t> r(0,0xffffffffffffffffLL); with the explicit LL for long long on the constant ?

On 11 March 2010 10:23, David Kaplan <davkaplan@gmail.com> wrote:
I'm having problems compiling this line of code on a 32bit system:
boost::uniform_int<uint64_t> r(0,0xffffffffffffffff);
compile-time error: "integer constant too large for 'long' type"
Ahh integer constant - I needed LL of course 0xffffffffffffffffLL. I'm getting to used to coding on my 64bit box when ints are of size 8! :)
participants (2)
-
David Kaplan
-
Joel Falcou