Finding the allocated size of a class?

Steven Schveighoffer schveiguy at yahoo.com
Sat Nov 10 08:22:26 PST 2007


"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 :)

-Steve 




More information about the Digitalmars-d-learn mailing list