DIP25 draft available for destruction

deadalnix deadalnix at gmail.com
Thu Feb 7 01:21:37 PST 2013


On Thursday, 7 February 2013 at 08:48:30 UTC, Rob T wrote:
> 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?
>

The frame pointer is, and it isn't dependent of @system or @safe .


More information about the Digitalmars-d mailing list