Finding the allocated size of a class?

Christopher Wright dhasenan at gmail.com
Sat Nov 10 08:25:29 PST 2007


Steven Schveighoffer Wrote:

> 
> "Christopher Wright" wrote
> > Does anyone know how to get the allocated size of a class without 
> > instantiating it?
> 
> if you are using D2.0, this should work I think:
> 
> size_t classSize = __traits(classInstanceSize, MyClass);
> 
> If using D 1.0, not sure :)

D'oh! Should've thought of that.

Thanks!

> -Steve 
> 
> 



More information about the Digitalmars-d-learn mailing list