Am Wed, 06 Feb 2013 02:38:17 -0500 schrieb Andrei Alexandrescu <[email protected]>:
> Probably it'll need a fair amount of tweaking. Anyhow it's in > destroyable form. > > http://wiki.dlang.org/DIP25 > > > Thanks, > > Andrei At first I was skeptical about how this would work with binary operator overloads where you have a lot of ref returns. (Think vector * matrix.) But as it seems, only stack local variables underly new restrictions. So anything that operates only on 'this' stays valid code. I'd still like to see some actual code that will break, since its bad to rely on lack of imagination and contrived examples. As for the address taking, I hope it doesn't end up in being nannied to much by the language. Like in the case with printf, it could really piss people off that don't understand the reasoning behind it. Make the error message informative for that: "Potential escape of pointer to stack local" or similar. -- Marco
