Is enum static?

Borislav Kosharov boby_dsm at abv.bg
Thu Aug 8 14:53:41 PDT 2013


On Thursday, 8 August 2013 at 21:49:31 UTC, Ali Çehreli wrote:
> On 08/08/2013 02:45 PM, Borislav Kosharov wrote:
>> If I have any enum in a class is it one for all instances or 
>> one per
>> instance? Also are enums one per thread or only one?
>
> More than that. :) enums are manifest constants.
>
> Imagine that enum as being pasted into source code as is. This 
> used to have surprising effects for AAs, as an enum AA would be 
> instantiated from scratch everywhere that AA enum was used in 
> the code. Perhaps it is still that way...
>
> Ali

What do you mean by AA? So enums are compile time constants that 
are like mini C macros?


More information about the Digitalmars-d-learn mailing list