DIP25 draft available for destruction

Rob T alanb at ucora.com
Thu Feb 7 00:48:29 PST 2013


On Thursday, 7 February 2013 at 05:54:29 UTC, deadalnix wrote:
> On Thursday, 7 February 2013 at 05:43:24 UTC, Rob T wrote:
>> In other words @safe should explicitly mean "I hereby verify 
>> that the code is safe" not "I will silently re-write your code 
>> in unknown ways to make it safe".
>>
>
> @safe never meant that and Andrei never suggested that.

I must have misunderstood something. What did he mean by this?

------------
> So you are saying this should compile?:
>
> struct S{
> int x;
> int foo()@safe{ return x; }
> }
>
> int delegate()@safe foo()@safe{
> S s;
> return &s.foo;
> }

Yah, it should, and it also should detect the escape and allocate 
foo's
frame on the heap.

Andrei
------------

What is being allocated on the heap?

--rt


More information about the Digitalmars-d mailing list