size of a class instance

Craig Black cblack at
Mon Nov 13 08:50:48 PST 2006

I like isizeof better than classinfo.init.length.  Not only for brevity, but 
a compile time value could be useful.

"Sean Kelly" <sean at> wrote in message 
news:ej9u8k$2ek2$1 at
> Bill Baxter wrote:
>> Is this really the best way to get the size of a class instance given the 
>> type?
>>   MyClass.classinfo.init.length;
> Yes.  And this only works at run time.  I proposed a new .isizeof property 
> to simplify things, but it didn't seem terribly popular.  See:
> Sean 

More information about the Digitalmars-d-learn mailing list