Get class size of object

Adam D. Ruppe destructionator at gmail.com
Sun Aug 11 09:36:51 PDT 2013


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;


More information about the Digitalmars-d-learn mailing list