Get class size of object

Dicebot public at dicebot.lv
Sun Aug 11 09:39:29 PDT 2013


On Sunday, 11 August 2013 at 16:36:53 UTC, Adam D. Ruppe wrote:
> On Sunday, 11 August 2013 at 04:25:21 UTC, JS wrote:
>> Given an object, is there a built in way to get the size of 
>> the class the object represents?
>
> try this:
>
> Object obj = new Whatever();
> auto size = typeid(obj).init.length;

This.


More information about the Digitalmars-d-learn mailing list