@trust is an encapsulation method, not an escape

Martin Krejcirik via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 03:57:51 PST 2015


If I understand it correctly, Walter is against adding trusted 
blocks (trusted {...}) into @safe functions. But what about 
having safe blocks in @trusted functions ?

int somefunc() @trusted
{
    int a = systemfunc();
    int b;

    @safe {
       b = safefunc(); // calling systemfunc() not allowed;
    }

    return a + b;
}


More information about the Digitalmars-d mailing list