Prototype of Ownership/Borrowing System for D

Ola Fosheim Grøstad ola.fosheim.grostad at
Thu Nov 21 10:40:58 UTC 2019

On Thursday, 21 November 2019 at 00:59:01 UTC, Timon Gehr wrote:
> allocation strategy. Therefore, allowing built-in pointers to 
> own their memory is vastly less useful than allowing 
> library-defined smart pointers to do so.

Yes, but if you could define all builtin pointers as defaulting 
to borrowing and introduce a syntax for marking a builtin pointer 
as owning. Then owning library structs could use that syntax to 
tell the compiler that that a pointer field is owning the 

If you also introduce a syntax for marking other types as 
borrowing/owning then you could use the same analysis for file 
handles, texture handles etc.

More information about the Digitalmars-d mailing list