Lazy Generation of Random Sequence
Nordlöw via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 26 03:50:27 PDT 2016
On Tuesday, 26 April 2016 at 10:31:22 UTC, Nordlöw wrote:
> How do I lazily generate a sequence of random instances of type
> `T` as an `InputRange`?
Ahh, I found it:
import std.range : generate, take;
import std.random : uniform;
auto randomSamples = generate!(() => uniform!Key).take(n);
I should have guessed that...
More information about the Digitalmars-d-learn
mailing list