Andrej Mitrovic <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from Andrej Mitrovic <> 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

import std.conv : to;
import std.stdio: writeln;
void main() 
    enum Foo { Zero, One }
    Foo f = Foo.One;

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:
------- You are receiving this mail because: -------

Reply via email to