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

           Summary: std.random.dice() should be templated on proportions.
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: dsim...@yahoo.com


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.


-- 

Reply via email to