@trusted and return ref

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 26 02:15:06 PST 2015


On Wednesday, 25 February 2015 at 22:59:01 UTC, anonymous wrote:
> rule-breaking that's going on there. A public trusted_malloc 
> would invite the un-initiated to shoot their feet.

That's entirely social...

> You mean the compiler should enforce E to be @safe/@trusted? 
> That wouldn't happen with an @trusted RCArray, because @trusted 
> code may call @system code.

If you can inject new code that is not marked @trusted explicitly 
into already written code that is marked @trusted, then the 
"trust type system" is broken.

> I'm a bit lost. What I meant was that the compiler infers @safe 
> for methods of templated structs when they don't call any 
> @system code.

It infers "@safe", but it does not provide validation.


More information about the Digitalmars-d-learn mailing list