What's wrong with this enum?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Feb 23 16:10:13 PST 2011


On 2/24/11, Jesse Phillips <jessekphillips+D at gmail.com> wrote:
> I believe it is because
>
> shapes.Circle["CoolCircle"] = 25;

Huh?

> perhaps a a defining:
>
> enmu shapes : const(int[string])
>
> would work?

Nope.
enumtwobug.d(10): Error: non-constant expression
["CoolCircle":cast(const(int))50]

>
> Anyway with DMD 2.052 I'm not getting your error.
>

What OS are you running? I'm running 2.052 and getting the error on
Windows. Maybe it's an OS-specific bug.


More information about the Digitalmars-d-learn mailing list