[Issue 4851] Three suggestions for std.random

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 23 05:49:25 PST 2013


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



--- Comment #5 from jens.k.mueller at gmx.de 2013-02-23 05:49:23 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> 
> > 3. choice can be expressed via
> >    auto choice = () => randomSample(r, 1, r.length).front;
> 
> That looks bad and it's error prone. It's not a replacement for choice() (and
> you have missed the input argument r).

Right.
Just for clarification. Adding

auto choice(R)(R r) { return randomSample(r, 1, r.length).front; };

would be fine?

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


More information about the Digitalmars-d-bugs mailing list