Get class size of object

Dicebot public at dicebot.lv
Sun Aug 11 09:43:08 PDT 2013


On Sunday, 11 August 2013 at 16:40:48 UTC, Maxim Fomin wrote:
> Yes, this is answer to the question. By the way, it can be 
> simply
>
> enum S = typeid(Whatever).init.length;

If exact type is statically known, no ClassInfo is required:

enum S = __traits(classInstanceSize, Whatever);


More information about the Digitalmars-d-learn mailing list