RandomSample with specified random number generator

jerro a at a.com
Tue Jun 12 19:15:02 PDT 2012


> Yes, I'll agree with you. But I don't know about others. It'll 
> be nice
> if others share their opinion such that your efforts won't be 
> wasted.
> That code was mostly written by Andrei and David.
>
> Jens

I, for one, agree that this:

> auto randomSample(R, Random)(R r, size_t n, Random gen = 
> Random(unpredictableSeed))

is the best way to solve this. The current implementation where
Random can be void and then RandomSample uses the global rng and
everything behaves slightly differently just seems like an endless
source of bugs.


More information about the Digitalmars-d mailing list