Why are multiple instances of the single enum created?

Per Nordlöw per.nordlow at gmail.com
Mon Feb 1 10:08:21 UTC 2021


On Monday, 1 February 2021 at 09:52:07 UTC, Jacob Carlborg wrote:
> If you don't want a new instance, then don't use `enum`. Use 
> `immutable` instead.

Agreed. My question is why does an `enum` require an extra 
instance from a compiler architecture point of view? Do all 
compilers handle compile-time enum instances in that way?


More information about the Digitalmars-d-learn mailing list