@trust is an encapsulation method, not an escape
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Fri Feb 6 00:57:42 PST 2015
On 2/6/2015 12:31 AM, Kagamin wrote:
> 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.
Cue my endless attempts to explain the difference between input errors and logic
errors :-(
More information about the Digitalmars-d
mailing list