Discussion Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Mar 20 15:12:33 UTC 2021


On Sat, Mar 20, 2021 at 02:20:06AM -0700, Walter Bright via Digitalmars-d wrote:
> One problem unaddressed is, for moveable structs, what if there *are*
> interior pointers, and they wind up pointing to a defunct object? The
> current compiler never moves structs, so this problem never occurs.
[...]

Is there a typo somewhere here?  I'm *pretty* sure the current compiler
*does* move structs in some cases, and that has caused problems in the
past where structs that store pointers to themselves will end up with
dangling pointers after, e.g., being returned from a function.


T

-- 
May you live all the days of your life. -- Jonathan Swift


More information about the Digitalmars-d mailing list