Object.factory() and exe file size bloat

BBasile via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 20 22:24:51 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:
>
> [...]
>
> What do you think?

This is a good idea. Some other langs use a similar system with a 
registration.
Eg instances can only be streamed if type is registered.

Other alternatives would be a pragma or an attribute to disable 
TypeInfo generation.
@NoTI.




More information about the Digitalmars-d mailing list