Get class size of object

Adam D. Ruppe destructionator at gmail.com
Sun Aug 11 12:58:24 PDT 2013


On Sunday, 11 August 2013 at 19:33:43 UTC, JS wrote:
> If you read Simen Kjaeraas's post you will see it doesn't work 
> directly with interfaces, which is what I was doing.

Oh, I see it now. I think typeid(interface) gives a different set 
of info.

This seems to work though:

         writeln(typeid(cast(Object)(f)).init.length);

Just casting the interface to Object before fetching the info.


More information about the Digitalmars-d-learn mailing list