How to copy an object to separate allocated memory?

Daniel Gibson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 24 10:07:03 PDT 2014


Am 24.07.2014 19:05, schrieb Gary Willoughby:
> I was reading Ali's book (http://ddili.org/ders/d.en/index.html) and saw
> this piece of code on how to get the true size of an object:
>
> MyClass* buffer = cast(MyClass*)GC.calloc(__traits(classInstanceSize,
> MyClass) * 10);
>
> That got me thinking, how would i actually 'fill' this memory with
> instances of that class?

std.conv.emplace()


More information about the Digitalmars-d-learn mailing list