Boost logo

Boost :

Subject: [boost] [Bug Sprint][random] overload resolution for constructors/seed
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-02 19:29:45


AMDG

I'm looking at the following tickets:

https://svn.boost.org/trac/boost/ticket/351
https://svn.boost.org/trac/boost/ticket/2887
https://svn.boost.org/trac/boost/ticket/2424

#351 and #2887 are effectively the same
boost::mt19937 prng1;
boost::mt19937 prng2(prng1); // does not call copy constructor

#2424 is
int seed = 0;
boost::mt19937 prng1(seed); // doesn't compile

#2424 can be fixed easily without breaking backwards compatibility.

Fixing #351 and #2887 will silently change the meaning of
the constructor call above. It will also be difficult to emulate the
previous (documented) behavior. However, looking at the current
standard draft, the constructor that causes these problems is not
present, so the standard mersenne twister will have a well behaved
copy constructor. Also, only lagged_fibonacci_01, mersenne_twister,
and subtract_with_carry provide the offending constructor, so
Boost.Random is not consistent. I'd like to have the copy constructor
called. What do others think?

When testing fixes, I found that rand48 behaves differently with
an int64_t seed than with an int32_t seed. According to the current
draft standard, they should be equivalent. Should rand48 be changed
or should I leave it alone?

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk