Prototype of Ownership/Borrowing System for D

IGotD- nise at nise.com
Wed Nov 20 18:32:42 UTC 2019


On Wednesday, 20 November 2019 at 06:57:55 UTC, mipri wrote:
>
>   void main() {
>       auto p = cast(Person*)malloc(Person.sizeof + 10);
>       birthday(p);
>       p.name.ptr[0] = 'B';
>       writeln(p);
>   }
>

If you would make main @live, would the compiler automatically 
put in a call to free for variable 'p' at the end of main?




More information about the Digitalmars-d mailing list