dxorshift: random number generators from the extended Xorshift family

Joseph Rushton Wakeling via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun May 15 08:43:47 PDT 2016


On Sunday, 15 May 2016 at 15:33:24 UTC, Joseph Rushton Wakeling 
wrote:
> I think you may have discovered a bug in `isForwardRange`

Less a bug than a subtlety, it seems.  Because of this line:
https://github.com/dlang/phobos/blob/778593d805a0c8bf39e318163e6d4004a7357904/std/range/primitives.d#L790

... the wrapper using `alias this` doesn't count as a forward 
range, because the result of `.save` is of the same type as the 
underlying RNG, rather than the wrapper itself.

The `.save` method still exists, though, although it's probably 
unlikely to be used in practice because `isForwardRange` 
evaluates to false.


More information about the Digitalmars-d-announce mailing list