The way I'd do it is:S s; auto heap = new S; *heap = s; that should work.
auto ps = std.conv.emplace(new S, s); Avoids the hacky array aliasing. // slightly more efficient auto ps2 = emplace(cast(S*)(new ubyte[](S.sizeof)).ptr, s); You will need to define a copy constructor for immutable fields.
