Thread overview
[Issue 2951] New: std.random.dice() should be templated on proportions.
May 07, 2009
d-bugmail
Aug 17, 2010
David Simcha
May 07, 2009
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: bugzilla@digitalmars.com
        ReportedBy: dsimcha@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.


-- 

October 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2951


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2951


David Simcha <dsimcha@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha@yahoo.com> 2010-08-16 20:39:00 PDT ---
Fixed SVN.

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