[Issue 8143] Safe std.conv.to enum conversion

2013-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #25 from Andrej Mitrovic 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 ma

[Issue 8143] Safe std.conv.to enum conversion

2013-02-13 Thread d-bugmail
/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: ---

[Issue 8143] Safe std.conv.to enum conversion

2013-02-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

[Issue 8143] Safe std.conv.to enum conversion

2013-02-10 Thread d-bugmail
/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

[Issue 8143] Safe std.conv.to enum conversion

2013-01-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added Keywords||pull AssignedTo|nob...@purema

[Issue 8143] Safe std.conv.to enum conversion

2012-10-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #21 from bearophile_h...@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

[Issue 8143] Safe std.conv.to enum conversion

2012-10-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #20 from Andrej Mitrovic 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

[Issue 8143] Safe std.conv.to enum conversion

2012-10-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #19 from bearophile_h...@eml.cc 2012-10-25 10:25:29 PDT --- (In reply to comment #18) > Not much (any) response in D NG. I could try and make a pull and see what > folks > have to say. OK. -- Configure issuemail: http://d.purema

[Issue 8143] Safe std.conv.to enum conversion

2012-10-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #18 from Andrej Mitrovic 2012-10-25 10:05:39 PDT --- (In reply to comment #17) > Created an attachment (id=1155) [details] > new > > Without purity it works ok though. Not much (any) response in D NG. I could try and make a pull

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added Attachment #1154|0 |1 is obsolete|

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #16 from bearophile_h...@eml.cc 2012-10-24 18:38:41 PDT --- (In reply to comment #15) > Ah it took me a while to realize you were looking for CTFE ability. Sorry for not being more clear. Another significant test case, this is use

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added Attachment #1153|0 |1 is obsolete|

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #14 from bearophile_h...@eml.cc 2012-10-24 17:43:17 PDT --- (In reply to comment #13) > > Is this supported? > > enum En[][] m1 = to!(En[][])([[10, 30], [30, 10]]); > > Yes. Then I suggest to add it to your tests, because it's not

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #13 from Andrej Mitrovic 2012-10-24 17:32:54 PDT --- Created an attachment (id=1153) d (In reply to comment #12) > Is this supported? > enum En[][] m1 = to!(En[][])([[10, 30], [30, 10]]); Yes. -- Configure issuemail: http://d.p

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #12 from bearophile_h...@eml.cc 2012-10-24 17:20:39 PDT --- (In reply to comment #11) > http://dpaste.dzfl.pl/f4e35e84 Please attach this in Bugzilla :-) > More tests welcome! Is this supported? enum En[][] m1 = to!(En[][])([[10

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #11 from Andrej Mitrovic 2012-10-24 10:58:10 PDT --- http://dpaste.dzfl.pl/f4e35e84 More tests welcome! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: -

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #10 from bearophile_h...@eml.cc 2012-10-24 10:36:19 PDT --- One more test case: enum En[][] m1 = to!(En[][])([[10, 30], [30, 10]]); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are rece

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #9 from Andrej Mitrovic 2012-10-24 10:31:14 PDT --- (In reply to comment #7) > One more test case: > En[][] m1 = to!(En[][])([[10, 30], [30, 10]]); Ah, haven't thought about arrays. Will fix.. > Have you compiled your code with "

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #8 from Andrej Mitrovic 2012-10-24 10:28:51 PDT --- (In reply to comment #6) > (In reply to comment #4) > > > I think customization like > > this might be friendlier than just rejecting conversion. > > It also makes the implement

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #7 from bearophile_h...@eml.cc 2012-10-24 10:26:36 PDT --- (In reply to comment #5) > Ok here's a first implementation, let me know if it can be improved before a > pull request is made (the docs will be improved too): One more test

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 bearophile_h...@eml.cc changed: What|Removed |Added AssignedTo|andrej.mitrov...@gmail.com |nob...@puremagic.com --- Comme

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added AssignedTo|nob...@puremagic.com|andrej.mitrov...@gmail.com --- Comme

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #4 from Andrej Mitrovic 2012-10-24 08:02:31 PDT --- Or alternatively require an additional alias parameter for the comparison function in case of floats? E.g. enum EF : float { C = 4.9 } float f = 4.9; static bool com

[Issue 8143] Safe std.conv.to enum conversion

2012-10-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 monarchdo...@gmail.com changed: What|Removed |Added CC||monarchdo...@gmail.com --- Com

[Issue 8143] Safe std.conv.to enum conversion

2012-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 --- Comment #2 from bearophile_h...@eml.cc 2012-10-23 18:59:14 PDT --- (In reply to comment #1) > This will fail internally if conv.to compares members via "==", because of > floating point comparison semantics. > > So the question is, is this

[Issue 8143] Safe std.conv.to enum conversion

2012-10-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8143 Andrej Mitrovic changed: What|Removed |Added CC||andrej.mitrov...@gmail.com --- Comme