RandomSample with specified random number generator
Jens Mueller
jens.k.mueller at gmx.de
Fri Jun 15 01:09:28 PDT 2012
Jonathan M Davis wrote:
> On Thursday, June 14, 2012 23:37:05 jerro wrote:
> > Issues with copying rngs are not unique to randomSample - anyone
> > who uses random number generators will run into them
> > sooner or later. So the problem is not that randomSample takes
> > a rng as a parameter - it's that rngs are value types. The
> > proper solution would be to make them reference types.
>
> Exactly. This has been discussed before (IIRC, there's a bug report which
> discusses it). The most straightforward solution is to change the random
> number generator ranges to classes, but that _will_ break code, because
> they're constructed completely differently.
Is this
http://d.puremagic.com/issues/show_bug.cgi?id=7067
the bug report you are referring to?
Jens
More information about the Digitalmars-d
mailing list