Prototype of Ownership/Borrowing System for D

Walter Bright newshound2 at
Wed Nov 27 06:33:59 UTC 2019

On 11/26/2019 9:31 AM, victoroak wrote:
> I think another great difference is that in your proposal a pointer has 
> ownership of the memory but I think that structs should have ownership over 
> resources and pointers are only borrows (like references in Rust), this way is 
> more useful and lets you track ownership over other resources other than memory.
> Another point is that on Timon's proposal scope pointers can be members of 
> structs so you can have a safe slice that borrows from a container.

That's the way both work.

More information about the Digitalmars-d mailing list