Is D suitable for my latest project?

chris stevens via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 8 12:30:15 PDT 2015


On Sunday, 6 September 2015 at 14:45:45 UTC, BBasile wrote:
> You have Object.factory for this. You can also use a custom 
> factory based on string comparison. (with some: static 
> if(condition) return new This; else static if(otherCondition) 
> return new That; etc).

I just had a look at Object.factory and this isn't actually what 
I wanted. I was looking for something that would allow me to 
create new (previously undefined) classes in D at runtime that I 
could then use with Object.factory to create instances of.

I think I can do this with Variants and dynamic, is this 
possible? Or is there another way?


More information about the Digitalmars-d-learn mailing list