
14 Feb
2006
14 Feb
'06
12:23 p.m.
Dear all, probably alread posted a hundred times, but the follwoing code hangs on my pc: int MakeRandomInt() { const int nMin = std::numeric_limits<int>::min(); const int nMax = std::numeric_limits<int>::max(); typedef boost::minstd_rand Generator; typedef boost::uniform_int<> Distributor; typedef boost::variate_generator<boost::minstd_rand, Distributor> VariateGenerator; Generator generator(static_cast<unsigned>(time(NULL))); Distributor uni_dist(nMin, nMax); VariateGenerator uni(generator, uni_dist); return uni(); } Making the range half the size does help. Did I miss the documentation? Wkr, me