Rust moving away from GC into reference counting
Adam D. Ruppe
destructionator at gmail.com
Mon Jun 3 07:33:10 PDT 2013
On Monday, 3 June 2013 at 14:20:06 UTC, Dicebot wrote:
> I don't see how struct with a disabled copy constructor is
> relevant to owned pointers.
My thought is then you can control access to the inner pointer
better that way. You couldn't even pass this struct to a function
without calling some kind of method, which could return a
different type to indicate that it is a lent pointer.
It also wouldn't need to be reference counted, since the refcount
is always going to be 1 because copying it is impossible.
> Most similar thing D has is "scope" qualifier concept (and that
> is why I do want it so hard :)) - hard guarantee that no
> pointer to your data will live longer than data itself. All
> normal pointers become managed pointers in that sense.
Yes, I'm just trying to do what we can with the language today.
More information about the Digitalmars-d
mailing list