http://d.puremagic.com/issues/show_bug.cgi?id=9339
--- Comment #6 from Andrej Mitrovic <[email protected]> 2013-01-17 17:01:43 PST --- (In reply to comment #4) > (In reply to comment #1) > > > enum arr = [EnumMembers!T]; > > Be very careful with enum arrays. They are very inefficient. Well, the compiler is very inefficient, static will do. > 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. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
