[Issue 9821] Smarter conversion of strings to enums
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 26 17:36:22 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9821
--- Comment #4 from Jared Miller <jared at economicmodeling.com> 2013-03-26 17:36:17 PDT ---
> This is a bad idea. It's much better to keep the semantics tidy, to avoid
> troubles down the line.
Sure, I understand if there's reluctance to change the meaning of to() in this
case. It's just unfortunate that for enums the original decision makes it
harder to work with real-world data (I admit it's nice to read on-screen).
But there should be at least some alternative function for converting strings
to enums using the base type, and it should be a standard option for any
(de)serialization code in Phobos. Considering how frequently string
serialization comes up in the real world, it will be well worth it.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list