get actual classinfo through an interface?

Christopher Wright dhasenan at gmail.com
Wed Nov 21 22:03:49 PST 2007


Robert Fraser wrote:
> BC wrote:
>> new question. since IInterface.classinfo returns IInterface, how to get
>> the actual value of the concrete class?
>>
> 
> typeid.
> 
> interface Foo { }
> class Bar : Foo { }
> // ...
> Foo foo = new Bar();
> TypeInfo ti = typeid(foo);

Error: foo is used as a type.


More information about the Digitalmars-d-learn mailing list