http://d.puremagic.com/issues/show_bug.cgi?id=8247



--- Comment #4 from jens.k.muel...@gmx.de 2012-06-15 00:54:20 PDT ---
Now I see why you want to pass RNG by reference. Because you may want that two
functions share the same generator.
But then I would go with passing them all by reference for consistency reasons.
And all functions have as default argument rndGen() which could be renamed to
defaultRNG().
randomShuffle is already doing it this way. Though I don't see why it sets the
template argument RandomGen to Random by default. This should be inferred
automatically by the default argument rndGen() anyway.
So randomCover and randomSample should follow the same approach.

I do not see why one needs to pass a RNG by value then. Admittedly I have never
used std.random. So I may have wrong use cases in mind.
But having a thread local RNG that is used by default should be okay.

@Jonathan
Why should a RNG type have reference semantics? I think it's fine to pass them
by reference where needed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to