[Issue 22552] moveEmplace wipes context pointer of nested struct contained in non-nested struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 30 09:17:36 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22552

--- Comment #2 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
Yes, bulk bit copy into destination would be fine, it's initializer blit that
causes a problem. Although, if we're going to recursively inspect structs and
static arrays to find any nested struct members, might as well make that
recursion also emit the blits. Also, I have another enhancement in mind that
could require recursive reflection: IMO, moving anything that has a pointer
should require wiping the source (except for context pointers). I'll file that
separately.

Also, there's the question of const fields... Bleh. I'll make the pull for this
issue later today, and we can discuss the details there.

--


More information about the Digitalmars-d-bugs mailing list