class .sizeof

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed Oct 28 11:12:15 PDT 2009


dsimcha wrote:
> For making the GC precise, I need to be able to get at the size of a class
> instance at compile time.  The .sizeof property returns the size of a
> reference, i.e. (void*).sizeof.  I need the amount of bytes an instance uses.

Not sure if it's what you're after, but there is something called 
__traits(classInstanceSize,T).

-Lars



More information about the Digitalmars-d mailing list