Should all enums be immutable?

Simen kjaeraas simen.kjaras at gmail.com
Thu Apr 7 09:03:50 PDT 2011


On Wed, 06 Apr 2011 21:42:35 +0200, Trass3r <un at known.com> wrote:

> Am 06.04.2011, 20:40 Uhr, schrieb Simen kjaeraas  
> <simen.kjaras at gmail.com>:
>> Yup. In theory, any immutable Foo declared at module scope (and likely
>> also those at static class/struct scope) could be elided by the linker
>> if it not used anywhere, but Optlink does not do that.
>
> Ok, I guess the hack works by replacing every occurrence of the constant  
> identifier in the AST with the initializer part of "enum foo =  
> initializer;"?
>
> So there would be no reason to keep enum manifest constants if this  
> Optlink bug was fixed?

Correct on both counts.

-- 
Simen


More information about the Digitalmars-d mailing list