Are anonymous enums mostly available for performance reasons?

bearophile bearophileHUGS at lycos.com
Sat Apr 3 05:11:49 PDT 2010


Mike Parker:

>Also, and this is a big one for me, anonymous enums generate no TypeInfo, which can save a lot of space in the binary over named enums.<

This is interesting. How much size differences do you see?

LDC compiler seems designed for practical usage, it has:
pragma(no_typeinfo)
You can use this pragma to stop typeinfo from being implicitly generated for a declaration. 

There is this too (but I think it's not implemented yet):
pragma(no_moduleinfo)

Similar pragmas can be added to dmd too.

Bye,
bearophile



More information about the Digitalmars-d mailing list