http://d.puremagic.com/issues/show_bug.cgi?id=4261
Andrej Mitrovic <andrej.mitrov...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrov...@gmail.com --- Comment #1 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2010-08-29 21:16:37 PDT --- When you need to get the name of the enumerated value, you have to use the 'to' template function from std.conv, as described in TDPL. Your example then becomes: import std.conv : to; import std.stdio: writeln; void main() { enum Foo { Zero, One } Foo f = Foo.One; writeln(to!string(f)); } Prints: One It wouldn't make much sense for an enum to behave differently in different contexts (e.g. comparing it in an if statement vs. using it with a writeln). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------