February 13, 2013 [Issue 9339] std.random.uniform!Enum should return random enum member | ||||
---|---|---|---|---|
| ||||
Posted in reply to hsteoh@quickfur.ath.cx | http://d.puremagic.com/issues/show_bug.cgi?id=9339 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 13, 2013 [Issue 9339] std.random.uniform!Enum should return random enum member | ||||
---|---|---|---|---|
| ||||
Posted in reply to hsteoh@quickfur.ath.cx | http://d.puremagic.com/issues/show_bug.cgi?id=9339 --- Comment #20 from bearophile_hugs@eml.cc 2013-02-12 17:33:09 PST --- One test case to try: import std.bigint, std.random; enum Foo : BigInt { zero = BigInt(0), one = BigInt(1) } void main() { auto x = uniform!Foo(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 13, 2013 [Issue 9339] std.random.uniform!Enum should return random enum member | ||||
---|---|---|---|---|
| ||||
Posted in reply to hsteoh@quickfur.ath.cx | http://d.puremagic.com/issues/show_bug.cgi?id=9339 --- Comment #21 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-12 17:38:45 PST --- (In reply to comment #20) > One test case to try: > > > import std.bigint, std.random; > > enum Foo : BigInt { > zero = BigInt(0), > one = BigInt(1) > } > > void main() { > auto x = uniform!Foo(); > } It works. It should actually work with any enum base types, since the only requirement is that the type is an enum. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 13, 2013 [Issue 9339] std.random.uniform!Enum should return random enum member | ||||
---|---|---|---|---|
| ||||
Posted in reply to hsteoh@quickfur.ath.cx | http://d.puremagic.com/issues/show_bug.cgi?id=9339 --- Comment #22 from github-bugzilla@puremagic.com 2013-02-13 00:13:44 PST --- Commit pushed to staging at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/128eaa901ccc0b011773e269e7f2adcd8e0d03b8 Fixes Issue 9339 - Uniform for enums. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation