On Wednesday, 29 August 2012 at 03:17:39 UTC, Era Scarecrow wrote:
To add on to this a little.. If you can only ref by calling, you ensure the variable is alive/valid when you are calling it regardless if it's stack or heap or global (But can't ensure it once the scope ends). Making a reference as a variable modifier won't work, but using a pointer you're already going lower level and it's all up to you the programmer to make sure it's right.

I think that's right; Otherwise ref wouldn't be allowed in @safe code (at all).

But couldn't the compiler disallow all unsafe ref use in @safe code, and allow all use of ref in @system and @trusted code?

Reply via email to