Placement new and @trusted

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Sep 10 13:13:34 UTC 2025


Ok, gotcha.

Placement new is @system, but you wanted to use it in an @safe function 
iff the constructor to be called is @safe as well.

The reason placement new is @system is because of double-init. It can't 
be a safe operation.


More information about the Digitalmars-d-learn mailing list