Placement New

JRM a at b.com
Sun Jul 4 07:06:02 PDT 2010


Does placement new work yet, or am I using it wrong?

import std.c.stdlib;

class Foo {}
void main() {
   Foo f = new(malloc(Foo.sizeof)) Foo();
}

With dmd 2.047: Error: no allocator for Foo


More information about the Digitalmars-d-learn mailing list