And if I have an already instantiated object? ---- Foo f = new Foo(); // reuse f's memory ---- Is there an nicer way to override the memory instead of: ----void[] buf = (cast(void*) f)[0 .. __traits(classInstanceSize, Foo)];
buf = typeid(Foo).init[]; // or: buf = f.classinfo.init[]; ---- ?
The void* cast looks very ugly.