isMutable doesn't work with enum ?

bearophile bearophileHUGS at lycos.com
Sun Jun 2 15:30:42 PDT 2013


Temtaime:

>
> 	enum int a = 5;
> 	writeln(isMutable!(typeof(a)));
>
> Writes true. Why?

If you run this:

enum int a = 5;
pragma(msg, typeof(a));
void main() {}

It prints "int". An int is mutable.


> How i can figure out if variable is "enum" constant ?

Why do you need to know that?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list