On Thursday, 20 September 2012 at 10:46:22 UTC, Johannes Pfau wrote:

That's what I did in std.digest. All Digests have a start() method, even if it's not necessary for that specific Digest. It's probably a good solution if you want a uniform interface for types which need
initialization and types which don't.

But there's also another, nice solution which should work: Introduce a new makeRNG template function. This func checks if the RNG has a seed function and calls it if available. Then you can do this for all RNGs:

auto rng = makeRNG!MersenneTwister();
auto rng = makeRNG!Misnstdrand();

These are good suggestions, but they are also breaking changes :/ I *AM* writing them down though, should we ever go down Jonathan M Davis's suggestion is changing the module.

BTW: std.container also has MakeContainter, but, AFAIK, I've never seen ANYONE use it :/

Reply via email to