enums

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 30 08:41:56 PDT 2014


Russel Winder:

> For me, enum means create an enumerated type. Thus "enum 
> double" to define a single value is just a contradiction.
>
> Enlightenment required…

In D enum can be used to define manifest constants. This means 
constants known at compile time. In practice for a double there 
isn't a lot of difference. In general you can't take the address 
of a manifest constant, unlike immutables.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list