Is it possible to store properties via opDispatch using tuples?

Tobias Pankrath tobias at pankrath.net
Fri Jan 17 11:08:54 PST 2014


> I can store properties of type A, B and C but when i retrieve 
> them they all come back as A because of array covariance. I 
> wonder if there is a way of casting them automagically to the 
> correct type.

So you basically want to declare a classmember for every name 
opDispatch is called with? That is not possible;

I thought about declaring it static in opDispatch itself, but 
than you can only have one instance. Next thought: Declare a 
static hashmap and store the values there, but then you could 
just use std.variant.


More information about the Digitalmars-d-learn mailing list