Is there a keyword to access the base class

Stephen Jones siwenjo at gmail.com
Wed Jun 19 16:10:39 PDT 2013


> Hm... would be a nice idiom to implement generically in D.  
> Like a type switch.
>
> -Steve

That is what I would prefer, but I tried:

writeln(to!(typeof(bars[1]))(bars[1]).val);	

to see if I could access the "DERIVED" (thanks) class type but 
even though bars[1] is initialized as a new Foos its type is 
still marked as Bar. So the question is, how do you find the 
derived class type when presented with only the super class?


More information about the Digitalmars-d-learn mailing list