What is the use case of RandomCover?

monarch_dodra monarchdodra at gmail.com
Tue Feb 19 04:25:11 PST 2013


On Tuesday, 19 February 2013 at 12:18:43 UTC, Joseph Rushton 
Wakeling wrote:
> On 02/19/2013 12:46 PM, Ivan Kazmenko wrote:
>> I'd like to note that my post is about randomCover, not 
>> randomSample.  I do see
>> the difference between the purpose of randomSample and 
>> randomShuffle.  But
>> randomCover's effect is, at the first glance, just a slower 
>> version of
>> randomSample wrapped as a lazy generator.
>
> To be honest, I think RandomCover is (statistically) unsafe to 
> use right now, as it takes a copy of the random number 
> generator it is given _by value_.

If it keeps a copy, how it is passed (value or ref) actually 
becomes irrelevant.

This is also a strong argument for the reference semantic PRNG 
approach.


More information about the Digitalmars-d-learn mailing list