isUniformRNG

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Thu May 8 10:18:59 PDT 2014


On 5/4/2014 4:08 PM, Joseph Rushton Wakeling via Digitalmars-d wrote:
>
> I should also be thanking you -- this reminded me that I needed to make
> some key changes to my std.random2 proposal, including this stricter
> isUniformRNG template:
> https://github.com/WebDrake/std.random2/commit/a071d8d182eb28516198bb292a0b45f86f4425fe
>
>
> How does this look to people?  And would there be interest in seeing
> this land in the existing std.random ... ?

Some good looking stuff in there. The separation is a nice improvement, 
and having a "shuffle" is something we could certainly use.

About avoiding problems from accidentally duplicating internal state, 
I'm not sure that changing to classes is really necessary for that. I 
addressed it in HashDRBG by simply making the internal state static. 
(Oops, or at least I meant to...fixing now...). The various InputRange 
instantiations (for the different possible elemement types) all draw 
from the same source (HashDRBGStream), so this should work out pretty 
well. I'd imagine the existing std.random algos could do something similar.



More information about the Digitalmars-d mailing list