CT usage only in executable

Daniel Murphy yebblies at nospamgmail.com
Fri Jul 16 22:01:00 PDT 2010


"strtr" <strtr at sp.am> wrote in message news:i1ql53$306c$1 at digitalmars.com...
> == Quote from Daniel Murphy (yebblies at nospamgmail.com)'s article
>> I think if you use enum instead of const/immutable the compiler is not 
>> meant
>> to put them in the executable (it might anyway in some/all cases).
>> eg.
>> module main;
>> enum CT_STRING = "int i=0;";
>> void main(){
>> mixin( CT_STRING );
>> }
>
> I'm using D1.
>
> Should I report this as a bug?


Sorry, I don't have D1 installed.  Can you use enum to declare manifest 
constants in D1 or is it a D2 thing?

If the string is left in the executable from

const char[] CT_STRING = "blah blah";
void main () {}

then I think this is a bug/enhancement for the linker. 




More information about the Digitalmars-d-learn mailing list