On Friday, 1 May 2015 at 11:01:29 UTC, Chris wrote:
This aside, how would I get something to load dynamically? It's either "mismatched function return type" or (with type check) "variable X cannot be read at compile time":

void main(string[] args) {
 auto type = args[1];
 auto myType = factory!type();
}

So it's back to classes/interfaces again? Hmmmm.

Obviously, myType's static type and factory's return type can't depend on a dynamic value like args[1].

You could let factory return a std.variant.Variant, but at that point maybe just go with classes.

Reply via email to