@trust is an encapsulation method, not an escape

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 00:31:06 PST 2015


On Thursday, 5 February 2015 at 23:39:39 UTC, Walter Bright wrote:
>   static void trustedMemcopy(T[] dest, T[] src) @trusted
>   {
>     assert(src.length == dest.length);
>     memcpy(dest.ptr, src.ptr, src.length * T.sizeof);
>   }

Should be enforce: assert doesn't guard against malicious usage.


More information about the Digitalmars-d mailing list