Bug 2951 – std.random.dice() should be templated on proportions.

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-05-07T10:50:00Z
Last change time
2015-06-09T01:26:27Z
Assigned to
andrei
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-05-07T10:50:06Z
The current signature for std.random.dice() is: size_t dice(R)(ref R rnd, double[] proportions...); Correct me if I'm wrong, but I think it would be trivial to change it to something like: size_t dice(T)(ref R rnd, T[] proportions...); This way, if you're passing in a pre-existing array instead of treating dice as a variadic function, you won't have to convert it.
Comment #1 by dsimcha — 2010-08-16T20:39:00Z
Fixed SVN.