Subject: [Boost-users] Random number generation
From: David Kaplan (davkaplan_at_[hidden])
Date: 2010-03-08 03:29:47


I'm using the following code to generate a random 64 bit value:

boost::mt19937 rng;
boost::uniform_int<uint64_t> r(0,0xffffffffffffffff);
boost::variate_generator<boost::mt19937&, boost::uniform_int<uint64_t> >
gen(rng, r);
uint64_t id = gen();

However it seems it's not random on each execution of the program? (rather I
get the same value again).
How do I randomise this properly?