Borrow Checking and Ownership Transfer

Araq rumpf_a at web.de
Sun May 11 04:36:10 UTC 2025


On Saturday, 10 May 2025 at 23:25:13 UTC, Walter Bright wrote:

> Microsoft's Managed C++ has regular pointers and gc pointers, 
> distinguished with different syntax. It was a failure in the 
> marketplace.

C++ has unique_ptr, shared_ptr, weak_ptr ... in addition to its 
raw pointers and C++ is doing fine.

The good news for you is that indeed you don't need to build 
these into your compiler and that D can likewise have these as a 
library. (Though for unique_ptr you might need better support for 
move operations.) The bad news is that your @live cannot be 
attached to a pointer so that library implementations of xxx_ptr 
cannot make use of it to enable more safety.


More information about the Digitalmars-d mailing list