Pure, Nothrow in Generic Programming

BCS none at anon.com
Fri Nov 27 12:07:57 PST 2009


Hello Walter,

> there's no
> way that an @safe function can guarantee it sends memcmp() arguments
> that will work safely with memcmp().

I think that's backwards. There's no way memcmp can be sure it's arguments 
are safe just because it's being called from a @safe function.

OTOH, if a @trusted function can do the needed checks, then so can a @safe 
function. The problem is that there is is no way for DMD to check that it 
has; thus the trusted wrapper.





More information about the Digitalmars-d mailing list