Object.factory() and exe file size bloat

Freddy via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 21 00:25:09 PDT 2015


On Friday, 21 August 2015 at 05:06:47 UTC, Walter Bright wrote:
> This function:
>
>   http://dlang.org/phobos/object.html#.Object.factory
>
> enables a program to instantiate any class defined in the 
> program. To make it work, though, every class in the program 
> has to have a TypeInfo generated for it. This leads to bloat:
> What do you think?

Can't we just make that Object.factory() an empty template and 
lazily instantiate class TypeInfo when needed.


More information about the Digitalmars-d mailing list