On Thu, Jul 23, 2009 at 3:13 PM, Steven Schveighoffer<[email protected]> wrote: > > Can you do that with classes, I don't know. I thought it was impossible to > allocate several classes in one block. It was pretty easy to do the custom > allocator with structs...
Ah, that's a good point. It is in fact possible; you can use typeid(Class).classinfo.init.length to get the size of an instance at runtime, or with D2, __traits(classInstanceSize, Class) will get you the same thing, at compile time. Though your other reasons are certainly more than enough justification to move to structs (which, like you said, they probably should have been in the first place) :)
