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



--- Comment #14 from bearophile_h...@eml.cc 2013-01-18 10:20:09 PST ---
(In reply to comment #6)

> > T uniform(T)()
> > if (is(T == enum) && isIntegral!T || isSomeChar!T)
> > {
> >     static immutable T[EnumMembers!T.length] members = [EnumMembers!T];
> >     return members[std.random.uniform(0, members.length)];
> > }
> 
> That's not doing what was requested.

Then I don't understand. This ER asks for that function overload to return a
"random enum member". Isn't members[std.random.uniform(0, members.length)] a
random enum member?

And beside what the OP is asking, uniform() returns single random values of a
type. Isn't this what I am doing there?

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

Reply via email to