enums

Philippe Sigaud via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 00:26:16 PDT 2014


On Sat, May 31, 2014 at 10:14 PM, bearophile via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

>> In contrast to those two examples where immutable can be used at compile
>> time, what are some other cases where it is necessary to use enum instead
>> of immutable?
>
>
> By default use enum if you define a compile-time-known value (...)

Now that we have immutable's that can be used inside templates, why
use an enum? Because it's 'inlined' in the code?

(I know the reason not to use it for an array or associative array, I
experimented that fully in my own code. Ouch!)


More information about the Digitalmars-d-learn mailing list