October 26, 2012 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #20 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-26 16:40:22 PDT --- (In reply to comment #16) > Another significant test case, this is useful in many simulations and games, to write safe tables and start conditions: > > enum Code : char { A='A', B='B', C='C' } > > void test() > { > ... > const code = to!(Code[][])(["ABCCBA", "BBAA"]); > with (Code) > assert(code == [[A, B, C, C, B, A], [B, B, A, A]]); > } I won't be able to do this, the problem is there is already a toImpl overload which takes a string and turns it into an enum. It has different semantics, it searches for matching member names rather than member values. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 27, 2012 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #21 from bearophile_hugs@eml.cc 2012-10-27 08:54:44 PDT --- (In reply to comment #20) > I won't be able to do this, the problem is there is already a toImpl overload which takes a string and turns it into an enum. It has different semantics, it searches for matching member names rather than member values. I see. See also Issue 5515 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 22, 2013 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull AssignedTo|nobody@puremagic.com |andrej.mitrovich@gmail.com --- Comment #22 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-21 16:50:10 PST --- https://github.com/D-Programming-Language/phobos/pull/1085 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 10, 2013 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #23 from github-bugzilla@puremagic.com 2013-02-10 10:15:26 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/72a09960890aedda14173304263c21ff3671262b Fixes Issue 8143 - Safe std.conv.to enum conversion https://github.com/D-Programming-Language/phobos/commit/f110604b593799f74af4cdedd6bd61c8275926e3 Merge pull request #897 from AndrejMitrovic/Fix_8143 Fix Issue 8143 - Safe std.conv.to enum conversion -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 10, 2013 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 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 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #24 from github-bugzilla@puremagic.com 2013-02-13 00:13:56 PST --- Commit pushed to staging at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e22fef3c36362aebd2c2fd60e344c32ec06dd0b3 Fixes Issue 8143 - Safe std.conv.to enum conversion -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 17, 2013 [Issue 8143] Safe std.conv.to enum conversion | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #25 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-17 15:05:24 PST --- *** Issue 5515 has been marked as a duplicate of this issue. *** -- 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