On Saturday, 1 February 2014 at 04:33:23 UTC, Frank Bauer wrote:
Yes, that is what Rust calls an "owning pointer". While we are at it, we might as well dream of "non-owning" or "borrowed" pointers, a.k.a. references in Rust. They don't have an effect on memory-deallocation when they go out of scope, but they prevent the owning pointer they "borrow" from (i.e. are assigned from) from being reassigned to a different object as long as there are borrowing references in scope. There is more to owning and borrowed pointers, but I think that is the essence.
I think D can use simplified model with only `scope`. Using it as storage class will effectively make data owned (not necessarily pointer), using it as qualifier will allow to "borrow" scope reference/pointer, for example, to pass as function argument.
